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 a949ae8 commit e405c61Copy full SHA for e405c61
tests/test_patch.py
@@ -794,16 +794,9 @@ def test_diff_default_blah(self):
794
changes=[
795
(1, None, 'The Way that can be told of is not the eternal Way;'),
796
(2, None, 'The name that can be named is not the eternal name.'),
797
- (3, 1, 'The Nameless is the origin of Heaven and Earth;'),
798
(4, None, 'The Named is the mother of all things.'),
799
(None, 2, 'The named is the mother of all things.'),
800
(None, 3, ''),
801
- (5, 4, 'Therefore let there always be non-being,'),
802
- (6, 5, ' so we may see their subtlety,'),
803
- (7, 6, 'And let there always be being,'),
804
- (9, 8, 'The two are the same,'),
805
- (10, 9, 'But after they are produced,'),
806
- (11, 10, ' they have different names.'),
807
(None, 11, 'They both may be called deep and profound.'),
808
(None, 12, 'Deeper and more profound,'),
809
(None, 13, 'The door of all subtleties!')],
whatthepatch/patch.py
@@ -512,10 +512,10 @@ def parse_default_diff(text):
512
kind = c.group(1)
513
line = c.group(2)
514
515
- if kind == '<':# and r != old_len:
+ if kind == '<' and (r != old_len or r == 0):
516
changes.append((old + r, None, line))
517
r += 1
518
- elif kind == '>':# and i != new_len:
+ elif kind == '>' and (i != new_len or i == 0):
519
changes.append((None, new + i, line))
520
i += 1
521
0 commit comments