Describe the bug
Missing some changed lines when using UnifiedDiffReader.parseUnifiedDiff
To Reproduce
Steps to reproduce the behavior:
- Example data
- simple programm snippet
- See error
|
@Test |
|
public void testParseIssue51() throws IOException { |
|
UnifiedDiff diff = UnifiedDiffReader.parseUnifiedDiff( |
|
UnifiedDiffReaderTest.class.getResourceAsStream("problem_diff_issue51.diff")); |
|
|
|
System.out.println(diff); |
|
|
|
assertThat(diff.getFiles().size()).isEqualTo(2); |
|
|
|
UnifiedDiffFile file1 = diff.getFiles().get(0); |
|
assertThat(file1.getFromFile()).isEqualTo("f1"); |
|
assertThat(file1.getPatch().getDeltas().size()).isEqualTo(1); |
|
|
|
assertThat(diff.getTail()).isNull(); |
|
} |
when debug this test, I found that patch of file f2 is empty, but in line 11 of problem_diff_issue51.diff is a changed line, right?
And the file1.getFromFile()).isEqualTo("f1"); should be old/f1 right? same as new/f1, old/f2, new/f2 in the diff file.
|
diff -U0 old/f2 new/f2 |
|
--- old/f2 2019-09-25 14:38:14.000000000 +0200 |
|
+++ new/f2 2019-09-25 14:38:32.000000000 +0200 |
|
@@ -1 +1 @@ |
|
-a\nc |

Expected behavior
A clear and concise description of what you expected to happen.
System
<groupId>io.github.java-diff-utils</groupId>
<artifactId>java-diff-utils</artifactId>
<version>4.5</version>
Describe the bug
Missing some changed lines when using UnifiedDiffReader.parseUnifiedDiff
To Reproduce
Steps to reproduce the behavior:
java-diff-utils/java-diff-utils/src/test/java/com/github/difflib/unifieddiff/UnifiedDiffReaderTest.java
Lines 145 to 159 in a8e4ce2
when debug this test, I found that patch of file f2 is empty, but in line 11 of problem_diff_issue51.diff is a changed line, right?
And the
file1.getFromFile()).isEqualTo("f1");should beold/f1right? same asnew/f1,old/f2,new/f2in the diff file.java-diff-utils/java-diff-utils/src/test/resources/com/github/difflib/unifieddiff/problem_diff_issue51.diff
Lines 7 to 11 in a8e4ce2
Expected behavior
A clear and concise description of what you expected to happen.
System