From c235ce89e1e02a76eac0be921e6e8fe12d9c6120 Mon Sep 17 00:00:00 2001 From: Brett Buddin Date: Mon, 4 Nov 2019 13:17:14 -0500 Subject: [PATCH] Test for testing non-existent and null-value keys. --- patch_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/patch_test.go b/patch_test.go index 66e5bd3..69851bc 100644 --- a/patch_test.go +++ b/patch_test.go @@ -468,6 +468,18 @@ var TestCases = []TestCase{ false, "/foo", }, + { + `{ "foo": "bar" }`, + `[ { "op": "test", "path": "/baz", "value": "bar" } ]`, + false, + "/baz", + }, + { + `{ "foo": "bar" }`, + `[ { "op": "test", "path": "/baz", "value": null } ]`, + true, + "/baz", + }, } func TestAllTest(t *testing.T) {