From 7b82f82de5e4c51b2e69f77f0e09dfe22323c7d7 Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Tue, 17 Dec 2024 16:49:19 -0500 Subject: [PATCH] test: list with multiple operations --- tests/test_add.py | 7 +++++++ tests/test_remove.py | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/tests/test_add.py b/tests/test_add.py index fc0db1a..a4281a1 100644 --- a/tests/test_add.py +++ b/tests/test_add.py @@ -79,6 +79,13 @@ def test_nested_append_1(self): ignore_patch=True, ) + def test_multiple_consecutive(self): + self.assertPatch( + [1, 2], + [1, 2, 3, 4], + [add("/2", 3), add("/3", 4)], + ) + class AddReplacesInDict(PatchTest): def test_value_to_none(self): diff --git a/tests/test_remove.py b/tests/test_remove.py index 6e75e57..8958161 100644 --- a/tests/test_remove.py +++ b/tests/test_remove.py @@ -49,6 +49,15 @@ def test_multiple(self): wrap_removed=False, ) + def test_multiple_consecutive(self): + self.assertPatch( + [1, 2, 3, 4], + [1, 2], + [remove("/3"), remove("/2")], + [4, 3], + wrap_removed=False, + ) + class RemoveRoot(PatchTest): def test_value(self):