|
@@ -1,7 +1,7 @@
|
1
|
1
|
#!/usr/bin/env python
|
2
|
2
|
# -*- coding: utf-8 -*-
|
3
|
3
|
|
4
|
|
-"""Unit test for cdiff"""
|
|
4
|
+"""Unit test for ydiff"""
|
5
|
5
|
|
6
|
6
|
import sys
|
7
|
7
|
import unittest
|
|
@@ -10,7 +10,7 @@ import subprocess
|
10
|
10
|
import os
|
11
|
11
|
|
12
|
12
|
sys.path.insert(0, '')
|
13
|
|
-import cdiff # nopep8
|
|
13
|
+import ydiff # nopep8
|
14
|
14
|
|
15
|
15
|
|
16
|
16
|
class Sequential(object):
|
|
@@ -41,27 +41,27 @@ class Sequential(object):
|
41
|
41
|
class PatchStreamTest(unittest.TestCase):
|
42
|
42
|
|
43
|
43
|
def test_is_empty(self):
|
44
|
|
- stream = cdiff.PatchStream(Sequential([]))
|
|
44
|
+ stream = ydiff.PatchStream(Sequential([]))
|
45
|
45
|
self.assertTrue(stream.is_empty())
|
46
|
46
|
|
47
|
|
- stream = cdiff.PatchStream(Sequential(['hello', 'world']))
|
|
47
|
+ stream = ydiff.PatchStream(Sequential(['hello', 'world']))
|
48
|
48
|
self.assertFalse(stream.is_empty())
|
49
|
49
|
|
50
|
50
|
def test_read_stream_header(self):
|
51
|
|
- stream = cdiff.PatchStream(Sequential([]))
|
|
51
|
+ stream = ydiff.PatchStream(Sequential([]))
|
52
|
52
|
self.assertEqual(stream.read_stream_header(1), [])
|
53
|
53
|
|
54
|
54
|
items = ['hello', 'world', 'again']
|
55
|
55
|
|
56
|
|
- stream = cdiff.PatchStream(Sequential(items))
|
|
56
|
+ stream = ydiff.PatchStream(Sequential(items))
|
57
|
57
|
self.assertEqual(stream.read_stream_header(2), items[:2])
|
58
|
58
|
|
59
|
|
- stream = cdiff.PatchStream(Sequential(items))
|
|
59
|
+ stream = ydiff.PatchStream(Sequential(items))
|
60
|
60
|
self.assertEqual(stream.read_stream_header(4), items[:])
|
61
|
61
|
|
62
|
62
|
def test_iter_after_read_stream_header(self):
|
63
|
63
|
items = ['hello', 'world', 'again', 'and', 'again']
|
64
|
|
- stream = cdiff.PatchStream(Sequential(items))
|
|
64
|
+ stream = ydiff.PatchStream(Sequential(items))
|
65
|
65
|
|
66
|
66
|
_ = stream.read_stream_header(2)
|
67
|
67
|
out = list(stream)
|
|
@@ -72,7 +72,7 @@ class DecodeTest(unittest.TestCase):
|
72
|
72
|
|
73
|
73
|
def test_normal(self):
|
74
|
74
|
utext = 'hello'.encode('utf-8')
|
75
|
|
- self.assertEqual('hello', cdiff.decode(utext))
|
|
75
|
+ self.assertEqual('hello', ydiff.decode(utext))
|
76
|
76
|
|
77
|
77
|
def test_latin_1(self):
|
78
|
78
|
text = '\x80\x02q\x01(U'
|
|
@@ -80,20 +80,20 @@ class DecodeTest(unittest.TestCase):
|
80
|
80
|
decoded_text = text.decode('latin-1')
|
81
|
81
|
else:
|
82
|
82
|
decoded_text = text
|
83
|
|
- self.assertEqual(decoded_text, cdiff.decode(text))
|
|
83
|
+ self.assertEqual(decoded_text, ydiff.decode(text))
|
84
|
84
|
|
85
|
85
|
|
86
|
86
|
class HunkTest(unittest.TestCase):
|
87
|
87
|
|
88
|
88
|
def test_get_old_text(self):
|
89
|
|
- hunk = cdiff.Hunk([], '@@ -1,2 +1,2 @@', (1, 2), (1, 2))
|
|
89
|
+ hunk = ydiff.Hunk([], '@@ -1,2 +1,2 @@', (1, 2), (1, 2))
|
90
|
90
|
hunk.append(('-', 'foo\n'))
|
91
|
91
|
hunk.append(('+', 'bar\n'))
|
92
|
92
|
hunk.append((' ', 'common\n'))
|
93
|
93
|
self.assertEqual(hunk._get_old_text(), ['foo\n', 'common\n'])
|
94
|
94
|
|
95
|
95
|
def test_get_new_text(self):
|
96
|
|
- hunk = cdiff.Hunk([], '@@ -1,2 +1,2 @@', (1, 2), (1, 2))
|
|
96
|
+ hunk = ydiff.Hunk([], '@@ -1,2 +1,2 @@', (1, 2), (1, 2))
|
97
|
97
|
hunk.append(('-', 'foo\n'))
|
98
|
98
|
hunk.append(('+', 'bar\n'))
|
99
|
99
|
hunk.append((' ', 'common\n'))
|
|
@@ -120,7 +120,7 @@ class DiffMarkupTest(unittest.TestCase):
|
120
|
120
|
+ spaced
|
121
|
121
|
"""
|
122
|
122
|
|
123
|
|
- hunk = cdiff.Hunk(['hunk header\n'], '@@ -1,5 +1,5 @@\n',
|
|
123
|
+ hunk = ydiff.Hunk(['hunk header\n'], '@@ -1,5 +1,5 @@\n',
|
124
|
124
|
(1, 5), (1, 5))
|
125
|
125
|
hunk.append(('-', 'hhello\n'))
|
126
|
126
|
hunk.append(('+', 'helloo\n'))
|
|
@@ -131,14 +131,14 @@ class DiffMarkupTest(unittest.TestCase):
|
131
|
131
|
hunk.append(('-', ' tabbed\n'))
|
132
|
132
|
hunk.append(('+', 'again\n'))
|
133
|
133
|
hunk.append(('+', ' spaced\n'))
|
134
|
|
- diff = cdiff.UnifiedDiff(
|
|
134
|
+ diff = ydiff.UnifiedDiff(
|
135
|
135
|
['header\n'], '--- old\n', '+++ new\n', [hunk])
|
136
|
136
|
return diff
|
137
|
137
|
|
138
|
138
|
def test_markup_traditional_hunk_header(self):
|
139
|
|
- hunk = cdiff.Hunk(['hunk header\n'], '@@ -0 +0 @@\n', (0, 0), (0, 0))
|
140
|
|
- diff = cdiff.UnifiedDiff([], '--- old\n', '+++ new\n', [hunk])
|
141
|
|
- marker = cdiff.DiffMarker()
|
|
139
|
+ hunk = ydiff.Hunk(['hunk header\n'], '@@ -0 +0 @@\n', (0, 0), (0, 0))
|
|
140
|
+ diff = ydiff.UnifiedDiff([], '--- old\n', '+++ new\n', [hunk])
|
|
141
|
+ marker = ydiff.DiffMarker()
|
142
|
142
|
|
143
|
143
|
out = list(marker.markup(diff))
|
144
|
144
|
self.assertEqual(len(out), 4)
|
|
@@ -149,10 +149,10 @@ class DiffMarkupTest(unittest.TestCase):
|
149
|
149
|
self.assertEqual(out[3], '\x1b[1;34m@@ -0 +0 @@\n\x1b[0m')
|
150
|
150
|
|
151
|
151
|
def test_markup_traditional_old_changed(self):
|
152
|
|
- hunk = cdiff.Hunk([], '@@ -1 +0,0 @@\n', (1, 0), (0, 0))
|
|
152
|
+ hunk = ydiff.Hunk([], '@@ -1 +0,0 @@\n', (1, 0), (0, 0))
|
153
|
153
|
hunk.append(('-', 'spam\n'))
|
154
|
|
- diff = cdiff.UnifiedDiff([], '--- old\n', '+++ new\n', [hunk])
|
155
|
|
- marker = cdiff.DiffMarker()
|
|
154
|
+ diff = ydiff.UnifiedDiff([], '--- old\n', '+++ new\n', [hunk])
|
|
155
|
+ marker = ydiff.DiffMarker()
|
156
|
156
|
|
157
|
157
|
out = list(marker.markup(diff))
|
158
|
158
|
self.assertEqual(len(out), 4)
|
|
@@ -163,10 +163,10 @@ class DiffMarkupTest(unittest.TestCase):
|
163
|
163
|
self.assertEqual(out[3], '\x1b[1;31m-spam\n\x1b[0m')
|
164
|
164
|
|
165
|
165
|
def test_markup_traditional_new_changed(self):
|
166
|
|
- hunk = cdiff.Hunk([], '@@ -0,0 +1 @@\n', (0, 0), (1, 0))
|
|
166
|
+ hunk = ydiff.Hunk([], '@@ -0,0 +1 @@\n', (0, 0), (1, 0))
|
167
|
167
|
hunk.append(('+', 'spam\n'))
|
168
|
|
- diff = cdiff.UnifiedDiff([], '--- old\n', '+++ new\n', [hunk])
|
169
|
|
- marker = cdiff.DiffMarker()
|
|
168
|
+ diff = ydiff.UnifiedDiff([], '--- old\n', '+++ new\n', [hunk])
|
|
169
|
+ marker = ydiff.DiffMarker()
|
170
|
170
|
|
171
|
171
|
out = list(marker.markup(diff))
|
172
|
172
|
self.assertEqual(len(out), 4)
|
|
@@ -177,12 +177,12 @@ class DiffMarkupTest(unittest.TestCase):
|
177
|
177
|
self.assertEqual(out[3], '\x1b[32m+spam\n\x1b[0m')
|
178
|
178
|
|
179
|
179
|
def test_markup_traditional_both_changed(self):
|
180
|
|
- hunk = cdiff.Hunk([], '@@ -1,2 +1,2 @@\n', (1, 2), (1, 2))
|
|
180
|
+ hunk = ydiff.Hunk([], '@@ -1,2 +1,2 @@\n', (1, 2), (1, 2))
|
181
|
181
|
hunk.append(('-', 'hella\n'))
|
182
|
182
|
hunk.append(('+', 'hello\n'))
|
183
|
183
|
hunk.append((' ', 'common\n'))
|
184
|
|
- diff = cdiff.UnifiedDiff([], '--- old\n', '+++ new\n', [hunk])
|
185
|
|
- marker = cdiff.DiffMarker()
|
|
184
|
+ diff = ydiff.UnifiedDiff([], '--- old\n', '+++ new\n', [hunk])
|
|
185
|
+ marker = ydiff.DiffMarker()
|
186
|
186
|
|
187
|
187
|
out = list(marker.markup(diff))
|
188
|
188
|
self.assertEqual(len(out), 6)
|
|
@@ -202,7 +202,7 @@ class DiffMarkupTest(unittest.TestCase):
|
202
|
202
|
|
203
|
203
|
def test_markup_side_by_side_padded(self):
|
204
|
204
|
diff = self._init_diff()
|
205
|
|
- marker = cdiff.DiffMarker(side_by_side=True, width=7)
|
|
205
|
+ marker = ydiff.DiffMarker(side_by_side=True, width=7)
|
206
|
206
|
|
207
|
207
|
out = list(marker.markup(diff))
|
208
|
208
|
self.assertEqual(len(out), 11)
|
|
@@ -256,7 +256,7 @@ class DiffMarkupTest(unittest.TestCase):
|
256
|
256
|
# This test is not valid anymore
|
257
|
257
|
def __test_markup_side_by_side_neg_width(self):
|
258
|
258
|
diff = self._init_diff()
|
259
|
|
- marker = cdiff.DiffMarker(side_by_side=True, width=-1)
|
|
259
|
+ marker = ydiff.DiffMarker(side_by_side=True, width=-1)
|
260
|
260
|
out = list(marker.markup(diff))
|
261
|
261
|
self.assertEqual(len(out), 11)
|
262
|
262
|
|
|
@@ -300,7 +300,7 @@ class DiffMarkupTest(unittest.TestCase):
|
300
|
300
|
|
301
|
301
|
def test_markup_side_by_side_off_by_one(self):
|
302
|
302
|
diff = self._init_diff()
|
303
|
|
- marker = cdiff.DiffMarker(side_by_side=True, width=6)
|
|
303
|
+ marker = ydiff.DiffMarker(side_by_side=True, width=6)
|
304
|
304
|
out = list(marker.markup(diff))
|
305
|
305
|
self.assertEqual(len(out), 11)
|
306
|
306
|
|
|
@@ -351,7 +351,7 @@ class DiffMarkupTest(unittest.TestCase):
|
351
|
351
|
|
352
|
352
|
def test_markup_side_by_side_wrapped(self):
|
353
|
353
|
diff = self._init_diff()
|
354
|
|
- marker = cdiff.DiffMarker(side_by_side=True, width=5)
|
|
354
|
+ marker = ydiff.DiffMarker(side_by_side=True, width=5)
|
355
|
355
|
out = list(marker.markup(diff))
|
356
|
356
|
self.assertEqual(len(out), 11)
|
357
|
357
|
|
|
@@ -403,7 +403,7 @@ class DiffMarkupTest(unittest.TestCase):
|
403
|
403
|
|
404
|
404
|
def test_markup_side_by_side_tabbed(self):
|
405
|
405
|
diff = self._init_diff()
|
406
|
|
- marker = cdiff.DiffMarker(side_by_side=True, width=8, tab_width=2)
|
|
406
|
+ marker = ydiff.DiffMarker(side_by_side=True, width=8, tab_width=2)
|
407
|
407
|
out = list(marker.markup(diff))
|
408
|
408
|
self.assertEqual(len(out), 11)
|
409
|
409
|
|
|
@@ -456,7 +456,7 @@ class DiffMarkupTest(unittest.TestCase):
|
456
|
456
|
|
457
|
457
|
class UnifiedDiffTest(unittest.TestCase):
|
458
|
458
|
|
459
|
|
- diff = cdiff.UnifiedDiff(None, None, None, None)
|
|
459
|
+ diff = ydiff.UnifiedDiff(None, None, None, None)
|
460
|
460
|
|
461
|
461
|
def test_is_hunk_meta_normal(self):
|
462
|
462
|
self.assertTrue(self.diff.is_hunk_meta('@@ -1 +1 @@'))
|
|
@@ -518,8 +518,8 @@ spam
|
518
|
518
|
@@ -1,2 +1,2 @@
|
519
|
519
|
"""
|
520
|
520
|
items = patch.splitlines(True)
|
521
|
|
- stream = cdiff.PatchStream(Sequential(items))
|
522
|
|
- parser = cdiff.DiffParser(stream)
|
|
521
|
+ stream = ydiff.PatchStream(Sequential(items))
|
|
522
|
+ parser = ydiff.DiffParser(stream)
|
523
|
523
|
self.assertEqual(parser._type, 'unified')
|
524
|
524
|
|
525
|
525
|
def test_type_detect_context(self):
|
|
@@ -533,8 +533,8 @@ spam
|
533
|
533
|
This part of the
|
534
|
534
|
"""
|
535
|
535
|
items = patch.splitlines(True)
|
536
|
|
- stream = cdiff.PatchStream(Sequential(items))
|
537
|
|
- parser = cdiff.DiffParser(stream)
|
|
536
|
+ stream = ydiff.PatchStream(Sequential(items))
|
|
537
|
+ parser = ydiff.DiffParser(stream)
|
538
|
538
|
self.assertEqual(parser._type, 'context')
|
539
|
539
|
|
540
|
540
|
def test_type_detect_neg(self):
|
|
@@ -546,8 +546,8 @@ spam
|
546
|
546
|
|
547
|
547
|
"""
|
548
|
548
|
items = patch.splitlines(True)
|
549
|
|
- stream = cdiff.PatchStream(Sequential(items))
|
550
|
|
- parser = cdiff.DiffParser(stream)
|
|
549
|
+ stream = ydiff.PatchStream(Sequential(items))
|
|
550
|
+ parser = ydiff.DiffParser(stream)
|
551
|
551
|
self.assertEqual(parser._type, 'unified')
|
552
|
552
|
|
553
|
553
|
def test_parse_invalid_hunk_meta(self):
|
|
@@ -559,8 +559,8 @@ spam
|
559
|
559
|
@@ -a,a +0 @@
|
560
|
560
|
"""
|
561
|
561
|
items = patch.splitlines(True)
|
562
|
|
- stream = cdiff.PatchStream(Sequential(items))
|
563
|
|
- parser = cdiff.DiffParser(stream)
|
|
562
|
+ stream = ydiff.PatchStream(Sequential(items))
|
|
563
|
+ parser = ydiff.DiffParser(stream)
|
564
|
564
|
self.assertRaises(RuntimeError, list, parser.get_diff_generator())
|
565
|
565
|
|
566
|
566
|
def test_parse_dangling_header(self):
|
|
@@ -574,8 +574,8 @@ spam
|
574
|
574
|
spam
|
575
|
575
|
"""
|
576
|
576
|
items = patch.splitlines(True)
|
577
|
|
- stream = cdiff.PatchStream(Sequential(items))
|
578
|
|
- parser = cdiff.DiffParser(stream)
|
|
577
|
+ stream = ydiff.PatchStream(Sequential(items))
|
|
578
|
+ parser = ydiff.DiffParser(stream)
|
579
|
579
|
|
580
|
580
|
out = list(parser.get_diff_generator())
|
581
|
581
|
self.assertEqual(len(out), 2)
|
|
@@ -596,8 +596,8 @@ spam
|
596
|
596
|
--- c
|
597
|
597
|
"""
|
598
|
598
|
items = patch.splitlines(True)
|
599
|
|
- stream = cdiff.PatchStream(Sequential(items))
|
600
|
|
- parser = cdiff.DiffParser(stream)
|
|
599
|
+ stream = ydiff.PatchStream(Sequential(items))
|
|
600
|
+ parser = ydiff.DiffParser(stream)
|
601
|
601
|
self.assertRaises(AssertionError, list, parser.get_diff_generator())
|
602
|
602
|
|
603
|
603
|
def test_parse_missing_hunk_meta(self):
|
|
@@ -612,8 +612,8 @@ spam
|
612
|
612
|
+++ d
|
613
|
613
|
"""
|
614
|
614
|
items = patch.splitlines(True)
|
615
|
|
- stream = cdiff.PatchStream(Sequential(items))
|
616
|
|
- parser = cdiff.DiffParser(stream)
|
|
615
|
+ stream = ydiff.PatchStream(Sequential(items))
|
|
616
|
+ parser = ydiff.DiffParser(stream)
|
617
|
617
|
|
618
|
618
|
out = list(parser.get_diff_generator())
|
619
|
619
|
self.assertEqual(len(out), 2)
|
|
@@ -635,8 +635,8 @@ spam
|
635
|
635
|
@@ -1,2 +1,2 @@
|
636
|
636
|
"""
|
637
|
637
|
items = patch.splitlines(True)
|
638
|
|
- stream = cdiff.PatchStream(Sequential(items))
|
639
|
|
- parser = cdiff.DiffParser(stream)
|
|
638
|
+ stream = ydiff.PatchStream(Sequential(items))
|
|
639
|
+ parser = ydiff.DiffParser(stream)
|
640
|
640
|
self.assertRaises(AssertionError, list, parser.get_diff_generator())
|
641
|
641
|
|
642
|
642
|
def test_parse_only_in_dir(self):
|
|
@@ -656,8 +656,8 @@ Only in foo: foo
|
656
|
656
|
common
|
657
|
657
|
"""
|
658
|
658
|
items = patch.splitlines(True)
|
659
|
|
- stream = cdiff.PatchStream(Sequential(items))
|
660
|
|
- parser = cdiff.DiffParser(stream)
|
|
659
|
+ stream = ydiff.PatchStream(Sequential(items))
|
|
660
|
+ parser = ydiff.DiffParser(stream)
|
661
|
661
|
|
662
|
662
|
out = list(parser.get_diff_generator())
|
663
|
663
|
self.assertEqual(len(out), 3)
|
|
@@ -677,8 +677,8 @@ Only in foo: foo
|
677
|
677
|
Only in foo: foo
|
678
|
678
|
"""
|
679
|
679
|
items = patch.splitlines(True)
|
680
|
|
- stream = cdiff.PatchStream(Sequential(items))
|
681
|
|
- parser = cdiff.DiffParser(stream)
|
|
680
|
+ stream = ydiff.PatchStream(Sequential(items))
|
|
681
|
+ parser = ydiff.DiffParser(stream)
|
682
|
682
|
|
683
|
683
|
out = list(parser.get_diff_generator())
|
684
|
684
|
self.assertEqual(len(out), 2)
|
|
@@ -702,8 +702,8 @@ Binary files a/1.pdf and b/1.pdf differ
|
702
|
702
|
common
|
703
|
703
|
"""
|
704
|
704
|
items = patch.splitlines(True)
|
705
|
|
- stream = cdiff.PatchStream(Sequential(items))
|
706
|
|
- parser = cdiff.DiffParser(stream)
|
|
705
|
+ stream = ydiff.PatchStream(Sequential(items))
|
|
706
|
+ parser = ydiff.DiffParser(stream)
|
707
|
707
|
|
708
|
708
|
out = list(parser.get_diff_generator())
|
709
|
709
|
self.assertEqual(len(out), 3)
|
|
@@ -738,8 +738,8 @@ index 529e8a3..ad71921 100755
|
738
|
738
|
common
|
739
|
739
|
"""
|
740
|
740
|
items = patch.splitlines(True)
|
741
|
|
- stream = cdiff.PatchStream(Sequential(items))
|
742
|
|
- parser = cdiff.DiffParser(stream)
|
|
741
|
+ stream = ydiff.PatchStream(Sequential(items))
|
|
742
|
+ parser = ydiff.DiffParser(stream)
|
743
|
743
|
|
744
|
744
|
out = list(parser.get_diff_generator())
|
745
|
745
|
self.assertEqual(len(out), 3)
|
|
@@ -764,8 +764,8 @@ Added: svn:keywords
|
764
|
764
|
+Id
|
765
|
765
|
"""
|
766
|
766
|
items = patch.splitlines(True)
|
767
|
|
- stream = cdiff.PatchStream(Sequential(items))
|
768
|
|
- parser = cdiff.DiffParser(stream)
|
|
767
|
+ stream = ydiff.PatchStream(Sequential(items))
|
|
768
|
+ parser = ydiff.DiffParser(stream)
|
769
|
769
|
out = list(parser.get_diff_generator())
|
770
|
770
|
self.assertEqual(len(out), 1)
|
771
|
771
|
self.assertEqual(len(out[0]._hunks), 2)
|
|
@@ -779,8 +779,8 @@ class MainTest(unittest.TestCase):
|
779
|
779
|
|
780
|
780
|
def setUp(self):
|
781
|
781
|
self._cwd = os.getcwd()
|
782
|
|
- self._ws = tempfile.mkdtemp(prefix='test_cdiff')
|
783
|
|
- self._non_ws = tempfile.mkdtemp(prefix='test_cdiff')
|
|
782
|
+ self._ws = tempfile.mkdtemp(prefix='test_ydiff')
|
|
783
|
+ self._non_ws = tempfile.mkdtemp(prefix='test_ydiff')
|
784
|
784
|
cmd = ('cd %s; git init; git config user.name me; '
|
785
|
785
|
'git config user.email me@example.org') % self._ws
|
786
|
786
|
subprocess.call(cmd, shell=True, stdout=subprocess.PIPE)
|
|
@@ -802,16 +802,16 @@ class MainTest(unittest.TestCase):
|
802
|
802
|
subprocess.call(cmd, stdout=subprocess.PIPE)
|
803
|
803
|
|
804
|
804
|
def test_preset_options(self):
|
805
|
|
- os.environ['CDIFF_OPTIONS'] = '--help'
|
806
|
|
- self.assertRaises(SystemExit, cdiff.main)
|
807
|
|
- os.environ.pop('CDIFF_OPTIONS', None)
|
|
805
|
+ os.environ['YDIFF_OPTIONS'] = '--help'
|
|
806
|
+ self.assertRaises(SystemExit, ydiff.main)
|
|
807
|
+ os.environ.pop('YDIFF_OPTIONS', None)
|
808
|
808
|
|
809
|
809
|
def test_read_diff(self):
|
810
|
810
|
sys.argv = sys.argv[:1]
|
811
|
811
|
self._change_file('read_diff')
|
812
|
812
|
|
813
|
813
|
os.chdir(self._ws)
|
814
|
|
- ret = cdiff.main()
|
|
814
|
+ ret = ydiff.main()
|
815
|
815
|
os.chdir(self._cwd)
|
816
|
816
|
self.assertEqual(ret, 0)
|
817
|
817
|
|
|
@@ -823,21 +823,21 @@ class MainTest(unittest.TestCase):
|
823
|
823
|
self._commit_file()
|
824
|
824
|
|
825
|
825
|
os.chdir(self._ws)
|
826
|
|
- ret = cdiff.main()
|
|
826
|
+ ret = ydiff.main()
|
827
|
827
|
os.chdir(self._cwd)
|
828
|
828
|
self.assertEqual(ret, 0)
|
829
|
829
|
|
830
|
830
|
def _test_read_diff_neg(self):
|
831
|
831
|
sys.argv = sys.argv[:1]
|
832
|
832
|
os.chdir(self._non_ws)
|
833
|
|
- ret = cdiff.main()
|
|
833
|
+ ret = ydiff.main()
|
834
|
834
|
os.chdir(self._cwd)
|
835
|
835
|
self.assertNotEqual(ret, 0)
|
836
|
836
|
|
837
|
837
|
def _test_read_log_neg(self):
|
838
|
838
|
sys.argv = [sys.argv[0], '--log']
|
839
|
839
|
os.chdir(self._non_ws)
|
840
|
|
- ret = cdiff.main()
|
|
840
|
+ ret = ydiff.main()
|
841
|
841
|
os.chdir(self._cwd)
|
842
|
842
|
self.assertNotEqual(ret, 0)
|
843
|
843
|
|