mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
Merge pull request #10672 from pedronis/store-unexpectedly-set
store: make sure expectedZeroFields in tests gets updated * drop Assumes * change the test so that the case where a field is now set gets noticed
This commit is contained in:
@@ -288,7 +288,6 @@ func (s *detailsV2Suite) TestInfoFromStoreSnap(c *C) {
|
||||
expectedZeroFields := []string{
|
||||
"SuggestedName",
|
||||
"InstanceKey",
|
||||
"Assumes",
|
||||
"OriginalTitle",
|
||||
"OriginalSummary",
|
||||
"OriginalDescription",
|
||||
@@ -324,9 +323,11 @@ func (s *detailsV2Suite) TestInfoFromStoreSnap(c *C) {
|
||||
checker(pfx+f.Name+".", v)
|
||||
continue
|
||||
}
|
||||
name := pfx + f.Name
|
||||
if reflect.DeepEqual(v.Interface(), reflect.Zero(f.Type).Interface()) {
|
||||
name := pfx + f.Name
|
||||
c.Check(expectedZeroFields, testutil.Contains, name, Commentf("%s not set", name))
|
||||
} else {
|
||||
c.Check(expectedZeroFields, Not(testutil.Contains), name, Commentf("%s unexpectedly set", name))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user