Rev 3924: Update the test cases for the new patience diff code. in http://bzr.arbash-meinel.com/branches/bzr/jam-integration
John Arbash Meinel
john at arbash-meinel.com
Tue Jan 6 15:07:24 GMT 2009
At http://bzr.arbash-meinel.com/branches/bzr/jam-integration
------------------------------------------------------------
revno: 3924
revision-id: john at arbash-meinel.com-20090106150704-cufylf2484gkoa0v
parent: john at arbash-meinel.com-20090106150242-frp82yhowbro6t1a
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: jam-integration
timestamp: Tue 2009-01-06 09:07:04 -0600
message:
Update the test cases for the new patience diff code.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_diff.py'
--- a/bzrlib/tests/test_diff.py 2008-09-01 14:03:34 +0000
+++ b/bzrlib/tests/test_diff.py 2009-01-06 15:07:04 +0000
@@ -1083,8 +1083,8 @@
'how are you today?\n']
unified_diff = bzrlib.patiencediff.unified_diff
psm = self._PatienceSequenceMatcher
- self.assertEquals([ '--- \n',
- '+++ \n',
+ self.assertEquals([ '--- \n',
+ '+++ \n',
'@@ -1,3 +1,2 @@\n',
' hello there\n',
'-world\n',
@@ -1095,8 +1095,8 @@
txt_a = map(lambda x: x+'\n', 'abcdefghijklmnop')
txt_b = map(lambda x: x+'\n', 'abcdefxydefghijklmnop')
# This is the result with LongestCommonSubstring matching
- self.assertEquals(['--- \n',
- '+++ \n',
+ self.assertEquals(['--- \n',
+ '+++ \n',
'@@ -1,6 +1,11 @@\n',
' a\n',
' b\n',
@@ -1111,8 +1111,8 @@
' f\n']
, list(unified_diff(txt_a, txt_b)))
# And the patience diff
- self.assertEquals(['--- \n',
- '+++ \n',
+ self.assertEquals(['--- \n',
+ '+++ \n',
'@@ -4,6 +4,11 @@\n',
' d\n',
' e\n',
@@ -1129,6 +1129,26 @@
, list(unified_diff(txt_a, txt_b,
sequencematcher=psm)))
+ def test_patience_unified_diff_with_dates(self):
+ txt_a = ['hello there\n',
+ 'world\n',
+ 'how are you today?\n']
+ txt_b = ['hello there\n',
+ 'how are you today?\n']
+ unified_diff = bzrlib.patiencediff.unified_diff
+ psm = self._PatienceSequenceMatcher
+ self.assertEquals([ '--- a 2008-08-08\n',
+ '+++ b 2008-09-09\n',
+ '@@ -1,3 +1,2 @@\n',
+ ' hello there\n',
+ '-world\n',
+ ' how are you today?\n'
+ ]
+ , list(unified_diff(txt_a, txt_b,
+ fromfile='a', tofile='b',
+ fromfiledate='2008-08-08',
+ tofiledate='2008-09-09',
+ sequencematcher=psm)))
class TestPatienceDiffLib_c(TestPatienceDiffLib):
@@ -1174,8 +1194,8 @@
unified_diff_files = bzrlib.patiencediff.unified_diff_files
psm = self._PatienceSequenceMatcher
- self.assertEquals(['--- a1 \n',
- '+++ b1 \n',
+ self.assertEquals(['--- a1\n',
+ '+++ b1\n',
'@@ -1,3 +1,2 @@\n',
' hello there\n',
'-world\n',
@@ -1190,8 +1210,8 @@
open('b2', 'wb').writelines(txt_b)
# This is the result with LongestCommonSubstring matching
- self.assertEquals(['--- a2 \n',
- '+++ b2 \n',
+ self.assertEquals(['--- a2\n',
+ '+++ b2\n',
'@@ -1,6 +1,11 @@\n',
' a\n',
' b\n',
@@ -1207,8 +1227,8 @@
, list(unified_diff_files('a2', 'b2')))
# And the patience diff
- self.assertEquals(['--- a2 \n',
- '+++ b2 \n',
+ self.assertEquals(['--- a2\n',
+ '+++ b2\n',
'@@ -4,6 +4,11 @@\n',
' d\n',
' e\n',
More information about the bazaar-commits
mailing list