fix test with t.Run()

This commit is contained in:
yugo kobayashi
2022-09-12 17:47:33 +00:00
parent cbb61fc668
commit 7c2e8845ad

View File

@@ -369,6 +369,7 @@ kind: Kustomization
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
fSys := filesys.MakeFsInMemory()
testutils_test.WriteTestKustomizationWith(fSys, []byte(test.input))
for filename, content := range test.files {
@@ -382,9 +383,8 @@ kind: Kustomization
require.Contains(t, string(content), "apiVersion: ")
require.Contains(t, string(content), "kind: Kustomization")
if diff := cmp.Diff([]byte(test.expected), content); diff != "" {
t.Errorf("%s: Mismatch (-expected, +actual):\n%s", test.name, diff)
}
require.Empty(t, cmp.Diff([]byte(test.expected), content))
})
}
}