diff --git a/pkg/kubectl/explain/field_lookup_test.go b/pkg/kubectl/explain/field_lookup_test.go index 4120c31f336..239ad704005 100644 --- a/pkg/kubectl/explain/field_lookup_test.go +++ b/pkg/kubectl/explain/field_lookup_test.go @@ -69,9 +69,9 @@ func TestFindField(t *testing.T) { gotPath = path.GetPath().String() } - if gotErr != test.err && gotPath != test.expectedPath { - t.Errorf("LookupSchemaForField(schema, %v) = (%v, %v), expected (%s, %v)", - test.path, gotErr, gotPath, test.expectedPath, test.err) + if gotErr != test.err || gotPath != test.expectedPath { + t.Errorf("LookupSchemaForField(schema, %v) = (path: %q, err: %q), expected (path: %q, err: %q)", + test.path, gotPath, gotErr, test.expectedPath, test.err) } } }