From e3038f0e8003e8c06011f32b71143f409ead9819 Mon Sep 17 00:00:00 2001 From: TwinProduction Date: Sat, 15 May 2021 22:26:51 -0400 Subject: [PATCH] Add TestEvalWithInvalidData --- jsonpath/jsonpath_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jsonpath/jsonpath_test.go b/jsonpath/jsonpath_test.go index dd3517fa..3e9063be 100644 --- a/jsonpath/jsonpath_test.go +++ b/jsonpath/jsonpath_test.go @@ -20,6 +20,15 @@ func TestEval(t *testing.T) { } } +func TestEvalWithInvalidData(t *testing.T) { + path := "simple" + data := `invalid data` + _, _, err := Eval(path, []byte(data)) + if err == nil { + t.Error("expected an error") + } +} + func TestEvalWithInvalidPath(t *testing.T) { path := "errors" data := `{}`