Skip to content

Commit

Permalink
Test for copying non-existent key.
Browse files Browse the repository at this point in the history
  • Loading branch information
brettbuddin committed Nov 4, 2019
1 parent a5df74a commit caa7f26
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions patch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,11 @@ var BadCases = []BadCase{
`{ "baz": "qux" }`,
`[ { "op": "replace", "path": "/foo", "value": "bar" } ]`,
},
// Can't copy from non-existent "from" key.
{
`{ "foo": "bar"}`,
`[{"op": "copy", "path": "/qux", "from": "/baz"}]`,
},
}

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

0 comments on commit caa7f26

Please sign in to comment.