Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork209
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 ina8e4ce2
| @Test | |
| publicvoidtestParseIssue51()throwsIOException { | |
| UnifiedDiffdiff =UnifiedDiffReader.parseUnifiedDiff( | |
| UnifiedDiffReaderTest.class.getResourceAsStream("problem_diff_issue51.diff")); | |
| System.out.println(diff); | |
| assertThat(diff.getFiles().size()).isEqualTo(2); | |
| UnifiedDiffFilefile1 =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 thefile1.getFromFile()).isEqualTo("f1"); should beold/f1 right? same asnew/f1,old/f2,new/f2 in the diff file.
Lines 7 to 11 ina8e4ce2
| diff -U0 old/f2 new/f2 | |
| --- old/f22019-09-25 14:38:14.000000000 +0200 | |
| +++ new/f22019-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
