Skip to content

Commit

Permalink
Additional null tests
Browse files Browse the repository at this point in the history
  • Loading branch information
evanphx committed Jan 12, 2024
1 parent 4a9dce7 commit 742691b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions v5/patch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,13 @@ var Cases = []Case{
false,
false,
},
{
`{}`,
`[{"op": "replace", "path": "", "value": null}]`,
`null`,
false,
false,
},
}

type BadCase struct {
Expand Down Expand Up @@ -732,6 +739,11 @@ var BadCases = []BadCase{
`[{"op": "replace", "path": "/foo/bar", "value": null}, {"op": "add", "path": "/foo/bar/0", "value": "blah"}]`,
false,
},
{
`{}`,
`[{"op": "replace", "path": ""}]`,
true,
},
}

// This is not thread safe, so we cannot run patch tests in parallel.
Expand Down

0 comments on commit 742691b

Please sign in to comment.