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

Commit1161243

Browse files
committed
1 parentf0fe7a2 commit1161243

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

‎src/main/java/com/github/difflib/text/DiffRowGenerator.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ private List<DiffRow> generateInlineDiffs(AbstractDelta<String> delta) throws Di
413413
* @param tag the tag name without angle brackets, just a word
414414
* @param cssClass the optional css class
415415
*/
416-
publicstaticvoidwrapInTag(List<String>sequence,intstartPosition,
416+
privatestaticvoidwrapInTag(List<String>sequence,intstartPosition,
417417
intendPosition,Function<Boolean,String>generator) {
418418
sequence.add(startPosition,generator.apply(true));
419419
sequence.add(endPosition,generator.apply(false));

‎src/test/java/com/github/difflib/text/DiffRowGeneratorTest.java‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,4 +315,55 @@ public void testGeneratorIssue15() throws DiffException, IOException {
315315
}
316316
}
317317
}
318+
319+
@Test
320+
publicvoidtestGeneratorIssue22()throwsDiffException {
321+
DiffRowGeneratorgenerator =DiffRowGenerator.create()
322+
.showInlineDiffs(true)
323+
.inlineDiffByWord(true)
324+
.oldTag(f ->"~")
325+
.newTag(f ->"**")
326+
.build();
327+
Stringaa ="This is a test senctence.";
328+
Stringbb ="This is a test for diffutils.\nThis is the second line.";
329+
List<DiffRow>rows =generator.generateDiffRows(
330+
Arrays.asList(aa.split("\n")),
331+
Arrays.asList(bb.split("\n")));
332+
333+
System.out.println(rows);
334+
}
335+
336+
@Test
337+
publicvoidtestGeneratorIssue22_2()throwsDiffException {
338+
DiffRowGeneratorgenerator =DiffRowGenerator.create()
339+
.showInlineDiffs(true)
340+
.inlineDiffByWord(true)
341+
.oldTag(f ->"~")
342+
.newTag(f ->"**")
343+
.build();
344+
Stringaa ="This is a test for diffutils.\nThis is the second line.";
345+
Stringbb ="This is a test senctence.";
346+
List<DiffRow>rows =generator.generateDiffRows(
347+
Arrays.asList(aa.split("\n")),
348+
Arrays.asList(bb.split("\n")));
349+
350+
System.out.println(rows);
351+
}
352+
353+
@Test
354+
publicvoidtestGeneratorIssue22_3()throwsDiffException {
355+
DiffRowGeneratorgenerator =DiffRowGenerator.create()
356+
.showInlineDiffs(true)
357+
.inlineDiffByWord(true)
358+
.oldTag(f ->"~")
359+
.newTag(f ->"**")
360+
.build();
361+
Stringaa ="This is a test senctence.";
362+
Stringbb ="This is a test for diffutils.\nThis is the second line.\nAnd one more.";
363+
List<DiffRow>rows =generator.generateDiffRows(
364+
Arrays.asList(aa.split("\n")),
365+
Arrays.asList(bb.split("\n")));
366+
367+
System.out.println(rows);
368+
}
318369
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp