@@ -417,4 +417,44 @@ public void testGenerationIssue44reportLinesUnchangedProblem() throws DiffExcept
417417 List <DiffRow > rows = generator .generateDiffRows (Arrays .asList ("<dt>To do</dt>" ), Arrays .asList ("<dt>Done</dt>" ));
418418 assertEquals ("[[CHANGE,<dt>~~T~~o~~ do~~</dt>,<dt>**D**o**ne**</dt>]]" , rows .toString ());
419419 }
420+
421+ @ Test
422+ public void testIgnoreWhitespaceIssue66 () throws DiffException {
423+ DiffRowGenerator generator = DiffRowGenerator .create ()
424+ .showInlineDiffs (true )
425+ .inlineDiffByWord (true )
426+ .ignoreWhiteSpaces (true )
427+ .mergeOriginalRevised (true )
428+ .oldTag (f -> "~" ) //introduce markdown style for strikethrough
429+ .newTag (f -> "**" ) //introduce markdown style for bold
430+ .build ();
431+
432+ //compute the differences for two test texts.
433+ //CHECKSTYLE:OFF
434+ List <DiffRow > rows = generator .generateDiffRows (
435+ Arrays .asList ("This\t is\t a\t test." ),
436+ Arrays .asList ("This is a test" ));
437+ //CHECKSTYLE:ON
438+
439+ assertEquals ("This is a test~.~" , rows .get (0 ).getOldLine ());
440+ }
441+
442+ @ Test
443+ public void testIgnoreWhitespaceIssue66_2 () throws DiffException {
444+ DiffRowGenerator generator = DiffRowGenerator .create ()
445+ .showInlineDiffs (true )
446+ .inlineDiffByWord (true )
447+ .ignoreWhiteSpaces (true )
448+ .mergeOriginalRevised (true )
449+ .oldTag (f -> "~" ) //introduce markdown style for strikethrough
450+ .newTag (f -> "**" ) //introduce markdown style for bold
451+ .build ();
452+
453+ //compute the differences for two test texts.
454+ List <DiffRow > rows = generator .generateDiffRows (
455+ Arrays .asList ("This is a test." ),
456+ Arrays .asList ("This is a test" ));
457+
458+ assertEquals ("This is a test~.~" , rows .get (0 ).getOldLine ());
459+ }
420460}
0 commit comments