Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Missing some changed lines when using UnifiedDiffReader.parseUnifiedDiff #83

Closed
@HuGanghui

Description

@HuGanghui

Describe the bug

Missing some changed lines when using UnifiedDiffReader.parseUnifiedDiff

To Reproduce
Steps to reproduce the behavior:

  1. Example data
  2. simple programm snippet
  3. See error

@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.

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

image

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp