Add test for invalid path

This commit is contained in:
TwinProduction 2021-03-09 19:39:22 -05:00
parent 541e0264ab
commit a48ec41bca

View File

@ -20,6 +20,15 @@ func TestEval(t *testing.T) {
} }
} }
func TestEvalWithInvalidPath(t *testing.T) {
path := "errors"
data := `{}`
_, _, err := Eval(path, []byte(data))
if err == nil {
t.Error("Expected error, but got", err)
}
}
func TestEvalWithLongSimpleWalk(t *testing.T) { func TestEvalWithLongSimpleWalk(t *testing.T) {
path := "long.simple.walk" path := "long.simple.walk"
data := `{"long": {"simple": {"walk": "value"}}}` data := `{"long": {"simple": {"walk": "value"}}}`