@@ -102,13 +102,17 @@ func Test_nulSeparatedAttributeWriter_ReadAttribute(t *testing.T) {
102102 }, attr )
103103}
104104
105- var expectedAttrs = Attributes {
106- LinguistGenerated : "unspecified" ,
107- LinguistDetectable : "unspecified" ,
108- LinguistDocumentation : "unspecified" ,
109- LinguistVendored : "unspecified" ,
110- LinguistLanguage : "Python" ,
111- GitlabLanguage : "unspecified" ,
105+ func expectedAttrs () * Attributes {
106+ return & Attributes {
107+ m : map [string ]Attribute {
108+ LinguistGenerated : "unspecified" ,
109+ LinguistDetectable : "unspecified" ,
110+ LinguistDocumentation : "unspecified" ,
111+ LinguistVendored : "unspecified" ,
112+ LinguistLanguage : "Python" ,
113+ GitlabLanguage : "unspecified" ,
114+ },
115+ }
112116}
113117
114118func Test_BatchChecker (t * testing.T ) {
@@ -127,7 +131,7 @@ func Test_BatchChecker(t *testing.T) {
127131 defer checker .Close ()
128132 attributes , err := checker .CheckPath ("i-am-a-python.p" )
129133 assert .NoError (t , err )
130- assert .Equal (t , expectedAttrs , attributes )
134+ assert .Equal (t , expectedAttrs () , attributes )
131135 })
132136
133137 // run git check-attr on work tree
@@ -148,7 +152,7 @@ func Test_BatchChecker(t *testing.T) {
148152 defer checker .Close ()
149153 attributes , err := checker .CheckPath ("i-am-a-python.p" )
150154 assert .NoError (t , err )
151- assert .Equal (t , expectedAttrs , attributes )
155+ assert .Equal (t , expectedAttrs () , attributes )
152156 })
153157
154158 if ! git .DefaultFeatures ().SupportCheckAttrOnBare {
@@ -163,6 +167,6 @@ func Test_BatchChecker(t *testing.T) {
163167
164168 attributes , err := checker .CheckPath ("i-am-a-python.p" )
165169 assert .NoError (t , err )
166- assert .Equal (t , expectedAttrs , attributes )
170+ assert .Equal (t , expectedAttrs () , attributes )
167171 })
168172}
0 commit comments