From 4a705c67a4870fe8f115ac27122d70cfa81009be Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 14 Sep 2017 09:43:54 -0700 Subject: [PATCH] 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 --- validate/validate_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/validate/validate_test.go b/validate/validate_test.go index 9c3e3ea2..536e79e0 100644 --- a/validate/validate_test.go +++ b/validate/validate_test.go @@ -75,6 +75,9 @@ func TestJSONSchema(t *testing.T) { assert.Equal(t, nil, errs) return } + if errs == nil { + t.Fatal("failed to raise the expected error") + } merr, ok := errs.(*multierror.Error) if !ok { t.Fatalf("non-multierror returned by CheckJSONSchema: %s", errs.Error())