We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5bbc36 commit 5878e1cCopy full SHA for 5878e1c
test/jsonpatch/operation/copy_test.exs
@@ -126,7 +126,17 @@ defmodule Jsonpatch.Operation.CopyTest do
126
assert %{"a" => [999, 999]} = patched
127
end
128
129
- test "Copy list element with invalid index" do
+ test "Copy list element from invalid index" do
130
+ patch = %Copy{from: "/a/6", path: "/a/0"}
131
+
132
+ target = %{"a" => [999, 888]}
133
134
+ patched_error = Operation.apply_op(patch, target)
135
136
+ assert {:error, :invalid_index, "6"} = patched_error
137
+ end
138
139
+ test "Copy list element to invalid index" do
140
patch = %Copy{from: "/a/0", path: "/a/5"}
141
142
target = %{"a" => [999, 888]}
0 commit comments