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

Commitdbd0b8f

Browse files
committed
fixes#64
1 parente37a523 commitdbd0b8f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

‎java-diff-utils/src/test/java/com/github/difflib/text/DiffRowGeneratorTest.java‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
importjava.util.List;
1010
importjava.util.regex.Pattern;
1111
importstaticjava.util.stream.Collectors.toList;
12+
importstaticorg.assertj.core.api.Assertions.assertThat;
1213
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
1314
importstaticorg.junit.jupiter.api.Assertions.assertTrue;
1415
importorg.junit.jupiter.api.Test;
@@ -457,4 +458,26 @@ public void testIgnoreWhitespaceIssue66_2() throws DiffException {
457458

458459
assertEquals("This is a test~.~",rows.get(0).getOldLine());
459460
}
461+
462+
@Test
463+
publicvoidtestIgnoreWhitespaceIssue64()throwsDiffException {
464+
DiffRowGeneratorgenerator =DiffRowGenerator.create()
465+
.showInlineDiffs(true)
466+
.inlineDiffByWord(true)
467+
.ignoreWhiteSpaces(true)
468+
.mergeOriginalRevised(true)
469+
.oldTag(f ->"~")//introduce markdown style for strikethrough
470+
.newTag(f ->"**")//introduce markdown style for bold
471+
.build();
472+
473+
//compute the differences for two test texts.
474+
List<DiffRow>rows =generator.generateDiffRows(
475+
Arrays.asList("test\n\ntestline".split("\n")),
476+
Arrays.asList("A new text line\n\nanother one".split("\n")));
477+
478+
assertThat(rows).extracting(item ->item.getOldLine())
479+
.containsExactly("~test~**A new text line**",
480+
"",
481+
"~testline~**another one**");
482+
}
460483
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp