apiextensions: fix variable name

This commit is contained in:
Dr. Stefan Schimanski 2019-06-10 18:07:24 +02:00
parent e280ec0fa2
commit 5d000b1339

View File

@ -29,11 +29,11 @@ import (
func TestPrune(t *testing.T) { func TestPrune(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
json string json string
dontPruneMetaAtRoot bool isResourceRoot bool
schema *structuralschema.Structural schema *structuralschema.Structural
expected string expected string
}{ }{
{name: "empty", json: "null", expected: "null"}, {name: "empty", json: "null", expected: "null"},
{name: "scalar", json: "4", schema: &structuralschema.Structural{}, expected: "4"}, {name: "scalar", json: "4", schema: &structuralschema.Structural{}, expected: "4"},
@ -397,7 +397,7 @@ func TestPrune(t *testing.T) {
} }
} }
} }
`, dontPruneMetaAtRoot: true, schema: &structuralschema.Structural{ `, isResourceRoot: true, schema: &structuralschema.Structural{
Generic: structuralschema.Generic{Type: "object"}, Generic: structuralschema.Generic{Type: "object"},
Properties: map[string]structuralschema.Structural{ Properties: map[string]structuralschema.Structural{
"pruned": { "pruned": {
@ -508,7 +508,7 @@ func TestPrune(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
Prune(in, tt.schema, tt.dontPruneMetaAtRoot) Prune(in, tt.schema, tt.isResourceRoot)
if !reflect.DeepEqual(in, expected) { if !reflect.DeepEqual(in, expected) {
var buf bytes.Buffer var buf bytes.Buffer
enc := json.NewEncoder(&buf) enc := json.NewEncoder(&buf)