Skip to content

Commit 4a705c6

Browse files
committed
validate/validate_test: Handle JSON Schema test not raising an error
Without this, tests that expect an error tried to cast the nil to a multierror (which failed) and then tried to format a failure message with errs.Error() (which panicked). Signed-off-by: W. Trevor King <[email protected]>
1 parent 4882fc1 commit 4a705c6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

validate/validate_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ func TestJSONSchema(t *testing.T) {
7575
assert.Equal(t, nil, errs)
7676
return
7777
}
78+
if errs == nil {
79+
t.Fatal("failed to raise the expected error")
80+
}
7881
merr, ok := errs.(*multierror.Error)
7982
if !ok {
8083
t.Fatalf("non-multierror returned by CheckJSONSchema: %s", errs.Error())

0 commit comments

Comments
 (0)