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

Fix for #141#144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
wumpz merged 3 commits intojava-diff-utils:masterfromhelbaroudy:master
Apr 9, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -353,7 +353,7 @@ private String extractFileName(String _line) {
line = line.substring(0, matcher.start());
}
line = line.split("\t")[0];
return line.substring(4).replaceFirst("^(a|b|old|new)(\\/)?", "")
return line.substring(4).replaceFirst("^(a|b|old|new)/", "")
.trim();
}

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -122,7 +122,7 @@ public void testParseIssue46() throws IOException {
assertThat(diff.getFiles().size()).isEqualTo(1);

UnifiedDiffFile file1 = diff.getFiles().get(0);
assertThat(file1.getFromFile()).isEqualTo(".vhd");
assertThat(file1.getFromFile()).isEqualTo("a.vhd");
assertThat(file1.getPatch().getDeltas().size()).isEqualTo(1);

assertThat(diff.getTail()).isNull();
Expand DownExpand Up@@ -384,4 +384,14 @@ public void testParseIssue123() throws IOException {

assertThat(diff.getFiles()).extracting(f -> f.getFromFile()).contains("src/java/main/org/apache/zookeeper/server/FinalRequestProcessor.java");
}

@Test
public void testParseIssue141() throws IOException {
UnifiedDiff diff = UnifiedDiffReader.parseUnifiedDiff(
UnifiedDiffReaderTest.class.getResourceAsStream("problem_diff_issue141.diff"));
UnifiedDiffFile file1 = diff.getFiles().get(0);

assertThat(file1.getFromFile()).isEqualTo("a.txt");
assertThat(file1.getToFile()).isEqualTo("a1.txt");
}
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
--- a.txt
+++ a1.txt
@@ -8,7 +8,7 @@
<Setting>
<Setting a>
<setting b>
- <value>23</value>
+ <value>24</value>
</setting b>
<setting c>
<value>1</value>

[8]ページ先頭

©2009-2025 Movatter.jp