mirror of
https://github.com/google/go-jsonnet.git
synced 2026-05-05 12:06:11 +02:00
fix order-dependent test
TestSdumpLargeDefinition is depnding on a global state change in TestSdumpReusedPointers. It can't pass if it runs in the wrong order. Fixes internal auto-filled bug.
This commit is contained in:
parent
4f4aa80dd7
commit
b2dbc0c524
@ -447,8 +447,9 @@ var Obj = &struct { Foo *Zeo; Bar *Zeo }{
|
||||
},
|
||||
}
|
||||
for _, test := range testcases {
|
||||
Config.StripPackageNames = true
|
||||
output := Sdump(test.input())
|
||||
opts := Config
|
||||
opts.StripPackageNames = true
|
||||
output := opts.Sdump(test.input())
|
||||
if test.expected != output {
|
||||
t.Errorf("test case %s failed, expected : \n%#v\n, got : \n%#v", test.name, test.expected, output)
|
||||
}
|
||||
@ -465,7 +466,7 @@ func TestSdumpLargeDefinition(t *testing.T) {
|
||||
}
|
||||
got := Sdump(&largeStruct{1, 2, 3, 4, 5})
|
||||
want := `var Obj = _Obj
|
||||
var _Obj = &largeStruct{
|
||||
var _Obj = &dump.largeStruct{
|
||||
ABCDEFGHIJKLMNOBQRSTUVWXYZ0: int(1),
|
||||
ABCDEFGHIJKLMNOBQRSTUVWXYZ1: int(2),
|
||||
ABCDEFGHIJKLMNOBQRSTUVWXYZ2: int(3),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user