@@ -158,26 +158,32 @@ func TestMapping(t *testing.T) {
158158
159159func TestReadTag (t * testing.T ) {
160160 testCases := []struct {
161- tag string
162- name string
163- optlock bool
161+ tag string
162+ name string
163+ optlock bool
164+ noupdate bool
164165 }{
165- {"-" , "-" , false },
166- {"foo" , "foo" , false },
167- {"foo," , "foo" , false },
168- {"foo,optlock" , "foo" , true },
169- {",optlock" , "" , true },
170- {",wrong" , "" , false },
171- {"," , "" , false },
166+ {"-" , "-" , false , false },
167+ {"foo" , "foo" , false , false },
168+ {"foo," , "foo" , false , false },
169+ {"foo,optlock" , "foo" , true , false },
170+ {",optlock" , "" , true , false },
171+ {",wrong" , "" , false , false },
172+ {",noupdate" , "" , false , true },
173+ {",optlock,noupdate" , "" , true , true },
174+ {"," , "" , false , false },
172175 }
173176 for _ , c := range testCases {
174- name , optlock := readTag (c .tag )
177+ name , optlock , noupdate := readTag (c .tag )
175178 if name != c .name {
176179 t .Errorf ("%s: expected name '%s', actual '%s'" , c .tag , c .name , name )
177180 }
178181 if optlock != c .optlock {
179182 t .Errorf ("%s: expected optlock '%t', actual '%t'" , c .tag , c .optlock , optlock )
180183 }
184+ if noupdate != c .noupdate {
185+ t .Errorf ("%s: expected optlock '%t', actual '%t'" , c .tag , c .noupdate , noupdate )
186+ }
181187 }
182188}
183189
0 commit comments