-
-
Notifications
You must be signed in to change notification settings - Fork 202
Closed
Description
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
Lines 145 to 159 in a8e4ce2
@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.
Lines 7 to 11 in a8e4ce2
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
- Java version 1.8
- Version
<groupId>io.github.java-diff-utils</groupId>
<artifactId>java-diff-utils</artifactId>
<version>4.5</version>
Metadata
Metadata
Assignees
Labels
No labels