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 b878d85 commit 845cf4aCopy full SHA for 845cf4a
tests.py
@@ -376,7 +376,15 @@ def test_json_patch(self):
376
patch = jsonpatch.make_patch(old, new)
377
new_from_patch = jsonpatch.apply_patch(old, patch)
378
self.assertEqual(new, new_from_patch)
379
-
+
380
+ def test_arrays_one_element_sequences(self):
381
+ """ Tests the case of multiple common one element sequences inside an array """
382
+ # see https://github.com/stefankoegl/python-json-patch/issues/30#issuecomment-155070128
383
+ src = [1,2,3]
384
+ dst = [3,1,4,2]
385
+ patch = jsonpatch.make_patch(src, dst)
386
+ res = jsonpatch.apply_patch(src, patch)
387
+ self.assertEqual(res, dst)
388
389
class OptimizationTests(unittest.TestCase):
390
def test_use_replace_instead_of_remove_add(self):
0 commit comments