Skip to content

Commit 3437668

Browse files
committed
#5 Validate fuzzy patch
Signed-off-by: Uilian Ries <uilianries@gmail.com>
1 parent 2780af1 commit 3437668

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

tests/10fuzzy/10fuzzy.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
diff --git a/Jamroot b/Jamroot
2+
index a6981dd..0c08f09 100644
3+
--- a/Jamroot
4+
+++ b/Jamroot
5+
@@ -1,3 +1,4 @@
6+
X
7+
Y
8+
+V
9+
W

tests/10fuzzy/Jamroot

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
X
2+
Y
3+
Z

tests/10fuzzy/[result]/Jamroot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
X
2+
Y
3+
V
4+
Z

tests/run_tests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,12 @@ def test_delete_file(self):
424424
pto.apply(strip=0, root=treeroot)
425425
self.assertFalse(os.path.exists(os.path.join(treeroot, 'deleted')))
426426

427+
def test_fuzzy_patch(self):
428+
treeroot = join(self.tmpdir, 'rootparent')
429+
shutil.copytree(join(TESTS, '10fuzzy'), treeroot)
430+
pto = patch_ng.fromfile(join(TESTS, '10fuzzy/10fuzzy.patch'))
431+
self.assertTrue(pto.apply(root=treeroot))
432+
427433

428434
class TestHelpers(unittest.TestCase):
429435
# unittest setting

0 commit comments

Comments
 (0)