Home | History | Annotate | Download | only in plaintext

Lines Matching refs:dmp

39   private diff_match_patch dmp;
46 dmp = new diff_match_patch();
55 assertEquals("diff_commonPrefix: Null case.", 0, dmp.diff_commonPrefix("abc", "xyz"));
57 assertEquals("diff_commonPrefix: Non-null case.", 4, dmp.diff_commonPrefix("1234abcdef", "1234xyz"));
59 assertEquals("diff_commonPrefix: Whole case.", 4, dmp.diff_commonPrefix("1234", "1234xyz"));
64 assertEquals("diff_commonSuffix: Null case.", 0, dmp.diff_commonSuffix("abc", "xyz"));
66 assertEquals("diff_commonSuffix: Non-null case.", 4, dmp.diff_commonSuffix("abcdef1234", "xyz1234"));
68 assertEquals("diff_commonSuffix: Whole case.", 4, dmp.diff_commonSuffix("1234", "xyz1234"));
73 assertNull("diff_halfMatch: No match.", dmp.diff_halfMatch("1234567890", "abcdef"));
75 assertArrayEquals("diff_halfMatch: Single Match #1.", new String[]{"12", "90", "a", "z", "345678"}, dmp.diff_halfMatch("1234567890", "a345678z"));
77 assertArrayEquals("diff_halfMatch: Single Match #2.", new String[]{"a", "z", "12", "90", "345678"}, dmp.diff_halfMatch("a345678z", "1234567890"));
79 assertArrayEquals("diff_halfMatch: Multiple Matches #1.", new String[]{"12123", "123121", "a", "z", "1234123451234"}, dmp.diff_halfMatch("121231234123451234123121", "a1234123451234z"));
81 assertArrayEquals("diff_halfMatch: Multiple Matches #2.", new String[]{"", "-=-=-=-=-=", "x", "", "x-=-=-=-=-=-=-="}, dmp.diff_halfMatch("x-=-=-=-=-=-=-=-=-=-=-=-=", "xx-=-=-=-=-=-=-="));
83 assertArrayEquals("diff_halfMatch: Multiple Matches #3.", new String[]{"-=-=-=-=-=", "", "", "y", "-=-=-=-=-=-=-=y"}, dmp.diff_halfMatch("-=-=-=-=-=-=-=-=-=-=-=-=y", "-=-=-=-=-=-=-=yy"));
92 assertLinesToCharsResultEquals("diff_linesToChars:", new LinesToCharsResult("\u0001\u0002\u0001", "\u0002\u0001\u0002", tmpVector), dmp.diff_linesToChars("alpha\nbeta\nalpha\n", "beta\nalpha\nbeta\n"));
99 assertLinesToCharsResultEquals("diff_linesToChars:", new LinesToCharsResult("", "\u0001\u0002\u0003\u0003", tmpVector), dmp.diff_linesToChars("", "alpha\r\nbeta\r\n\r\n\r\n"));
105 assertLinesToCharsResultEquals("diff_linesToChars:", new LinesToCharsResult("\u0001", "\u0002", tmpVector), dmp.diff_linesToChars("a", "b"));
122 assertLinesToCharsResultEquals("diff_linesToChars: More than 256.", new LinesToCharsResult(chars, "", tmpVector), dmp.diff_linesToChars(lines, ""));
137 dmp.diff_charsToLines(diffs, tmpVector);
156 dmp.diff_charsToLines(diffs, tmpVector);
163 dmp.diff_cleanupMerge(diffs);
167 dmp.diff_cleanupMerge(diffs);
171 dmp.diff_cleanupMerge(diffs);
175 dmp.diff_cleanupMerge(diffs);
179 dmp.diff_cleanupMerge(diffs);
183 dmp.diff_cleanupMerge(diffs);
187 dmp.diff_cleanupMerge(diffs);
191 dmp.diff_cleanupMerge(diffs);
195 dmp.diff_cleanupMerge(diffs);
199 dmp.diff_cleanupMerge(diffs);
203 dmp.diff_cleanupMerge(diffs);
210 dmp.diff_cleanupSemanticLossless(diffs);
214 dmp.diff_cleanupSemanticLossless(diffs);
218 dmp.diff_cleanupSemanticLossless(diffs);
222 dmp.diff_cleanupSemanticLossless(diffs);
226 dmp.diff_cleanupSemanticLossless(diffs);
230 dmp.diff_cleanupSemanticLossless(diffs);
234 dmp.diff_cleanupSemanticLossless(diffs);
241 dmp.diff_cleanupSemantic(diffs);
245 dmp.diff_cleanupSemantic(diffs);
249 dmp.diff_cleanupSemantic(diffs);
253 dmp.diff_cleanupSemantic(diffs);
257 dmp.diff_cleanupSemantic(diffs);
261 dmp.diff_cleanupSemantic(diffs);
267 dmp.Diff_EditCost = 4;
269 dmp.diff_cleanupEfficiency(diffs);
273 dmp.diff_cleanupEfficiency(diffs);
277 dmp.diff_cleanupEfficiency(diffs);
281 dmp.diff_cleanupEfficiency(diffs);
285 dmp.diff_cleanupEfficiency(diffs);
288 dmp.Diff_EditCost = 5;
290 dmp.diff_cleanupEfficiency(diffs);
292 dmp.Diff_EditCost = 4;
298 assertEquals("diff_prettyHtml:", "<SPAN TITLE=\"i=0\">a&para;<BR></SPAN><DEL STYLE=\"background:#FFE6E6;\" TITLE=\"i=2\">&lt;B&gt;b&lt;/B&gt;</DEL><INS STYLE=\"background:#E6FFE6;\" TITLE=\"i=2\">c&amp;d</INS>", dmp.diff_prettyHtml(diffs));
304 assertEquals("diff_text1:", "jumps over the lazy", dmp.diff_text1(diffs));
305 assertEquals("diff_text2:", "jumped over a lazy", dmp.diff_text2(diffs));
311 String text1 = dmp.diff_text1(diffs);
314 String delta = dmp.diff_toDelta(diffs);
318 assertEquals("diff_fromDelta: Normal.", diffs, dmp.diff_fromDelta(text1, delta));
322 dmp.diff_fromDelta(text1 + "x", delta);
330 dmp.diff_fromDelta(text1.substring(1), delta);
338 dmp.diff_fromDelta("", "+%c3%xy");
346 text1 = dmp.diff_text1(diffs);
349 delta = dmp.diff_toDelta(diffs);
352 assertEquals("diff_fromDelta: Unicode.", diffs, dmp.diff_fromDelta(text1, delta));
356 String text2 = dmp.diff_text2(diffs);
359 delta = dmp.diff_toDelta(diffs);
363 assertEquals("diff_fromDelta: Unchanged characters.", diffs, dmp.diff_fromDelta("", delta));
369 assertEquals("diff_xIndex: Translation on equality.", 5, dmp.diff_xIndex(diffs, 2));
372 assertEquals("diff_xIndex: Translation on deletion.", 1, dmp.diff_xIndex(diffs, 3));
377 assertEquals("Levenshtein with trailing equality.", 4, dmp.diff_levenshtein(diffs));
380 assertEquals("Levenshtein with leading equality.", 4, dmp.diff_levenshtein(diffs));
383 assertEquals("Levenshtein with middle equality.", 7, dmp.diff_levenshtein(diffs));
388 assertTrue("diff_footprint:", dmp.diff_footprint(1, 10) != dmp.diff_footprint(10, 1));
397 row_set.add(dmp.diff_footprint(0, 0));
400 row_set.add(dmp.diff_footprint(0, 1));
401 row_set.add(dmp.diff_footprint(1, 0));
404 row_set.add(dmp.diff_footprint(0, 2));
405 row_set.add(dmp.diff_footprint(2, 0));
406 row_set.add(dmp.diff_footprint(2, 2));
409 row_set.add(dmp.diff_footprint(0, 3));
410 row_set.add(dmp.diff_footprint(2, 3));
411 row_set.add(dmp.diff_footprint(3, 0));
412 row_set.add(dmp.diff_footprint(4, 3));
415 row_set.add(dmp.diff_footprint(0, 4));
416 row_set.add(dmp.diff_footprint(2, 4));
417 row_set.add(dmp.diff_footprint(4, 0));
418 row_set.add(dmp.diff_footprint(4, 4));
419 row_set.add(dmp.diff_footprint(5, 3));
422 row_set.add(dmp.diff_footprint(0, 5));
423 row_set.add(dmp.diff_footprint(2, 5));
424 row_set.add(dmp.diff_footprint(4, 5));
425 row_set.add(dmp.diff_footprint(5, 0));
426 row_set.add(dmp.diff_footprint(6, 3));
427 row_set.add(dmp.diff_footprint(6, 5));
430 row_set.add(dmp.diff_footprint(0, 6));
431 row_set.add(dmp.diff_footprint(2, 6));
432 row_set.add(dmp.diff_footprint(4, 6));
433 row_set.add(dmp.diff_footprint(6, 6));
434 row_set.add(dmp.diff_footprint(7, 5));
438 assertEquals("diff_path1: Single letters.", diffs, dmp.diff_path1(v_map, "A1B2C3D", "W12X3"));
443 assertEquals("diff_path2: Single letters.", diffs, dmp.diff_path2(v_map, "4E5F6G", "4Y56Z"));
450 row_set.add(dmp.diff_footprint(0, 0));
453 row_set.add(dmp.diff_footprint(0, 1));
454 row_set.add(dmp.diff_footprint(1, 0));
457 row_set.add(dmp.diff_footprint(0, 2));
458 row_set.add(dmp.diff_footprint(1, 1));
459 row_set.add(dmp.diff_footprint(2, 0));
462 row_set.add(dmp.diff_footprint(0, 3));
463 row_set.add(dmp.diff_footprint(1, 2));
464 row_set.add(dmp.diff_footprint(2, 1));
465 row_set.add(dmp.diff_footprint(3, 0));
468 row_set.add(dmp.diff_footprint(0, 4));
469 row_set.add(dmp.diff_footprint(1, 3));
470 row_set.add(dmp.diff_footprint(3, 1));
471 row_set.add(dmp.diff_footprint(4, 0));
472 row_set.add(dmp.diff_footprint(4, 4));
476 assertEquals("diff_path1: Double letters.", diffs, dmp.diff_path1(v_map, "AB12", "WX12"));
482 row_set.add(dmp.diff_footprint(0, 0));
485 row_set.add(dmp.diff_footprint(0, 1));
486 row_set.add(dmp.diff_footprint(1, 0));
489 row_set.add(dmp.diff_footprint(1, 1));
490 row_set.add(dmp.diff_footprint(2, 0));
491 row_set.add(dmp.diff_footprint(2, 4));
494 row_set.add(dmp.diff_footprint(2, 1));
495 row_set.add(dmp.diff_footprint(2, 5));
496 row_set.add(dmp.diff_footprint(3, 0));
497 row_set.add(dmp.diff_footprint(3, 4));
500 row_set.add(dmp.diff_footprint(2, 6));
501 row_set.add(dmp.diff_footprint(3, 5));
502 row_set.add(dmp.diff_footprint(4, 4));
506 assertEquals("diff_path2: Double letters.", diffs, dmp.diff_path2(v_map, "CD34", "34YZ"));
512 assertEquals("diff_main: Null case.", diffs, dmp.diff_main("abc", "abc", false));
515 assertEquals("diff_main: Simple insertion.", diffs, dmp.diff_main("abc", "ab123c", false));
518 assertEquals("diff_main: Simple deletion.", diffs, dmp.diff_main("a123bc", "abc", false));
521 assertEquals("diff_main: Two insertions.", diffs, dmp.diff_main("abc", "a123b456c", false));
524 assertEquals("diff_main: Two deletions.", diffs, dmp.diff_main("a123b456c", "abc", false));
528 dmp.Diff_Timeout = 0;
529 dmp.Diff_DualThreshold = 32;
531 assertEquals("diff_main: Simple case #1.", diffs, dmp.diff_main("a", "b", false));
534 assertEquals("diff_main: Simple case #2.", diffs, dmp.diff_main("Apples are a fruit.", "Bananas are also fruit.", false));
537 assertEquals("diff_main: Simple case #3.", diffs, dmp.diff_main("ax\t", "\u0680x\000", false));
540 assertEquals("diff_main: Overlap #1.", diffs, dmp.diff_main("1ayb2", "abxab", false));
543 assertEquals("diff_main: Overlap #2.", diffs, dmp.diff_main("abcy", "xaxcxabc", false));
546 dmp.Diff_DualThreshold = 2;
548 assertEquals("diff_main: Overlap #3.", diffs, dmp.diff_main("abcy", "xaxcxabc", false));
550 dmp.Diff_DualThreshold = 32;
551 dmp.Diff_Timeout = 0.001f; // 1ms
559 assertNull("diff_main: Timeout.", dmp.diff_map(a, b));
560 dmp.Diff_Timeout = 0;
566 assertEquals("diff_main: Simple.", dmp.diff_main(a, b, true), dmp.diff_main(a, b, false));
570 String[] texts_linemode = diff_rebuildtexts(dmp.diff_main(a, b, true));
571 String[] texts_textmode = diff_rebuildtexts(dmp.diff_main(a, b, false));
576 dmp.diff_main(null, null);
592 assertEquals("match_alphabet: Unique.", bitmask, dmp.match_alphabet("abc"));
596 assertEquals("match_alphabet: Duplicates.", bitmask, dmp.match_alphabet("abcaba"));
601 dmp.Match_Distance = 100;
602 dmp.Match_Threshold = 0.5f;
603 assertEquals("match_bitap: Exact match #1.", 5, dmp.match_bitap("abcdefghijk", "fgh", 5));
605 assertEquals("match_bitap: Exact match #2.", 5, dmp.match_bitap("abcdefghijk", "fgh", 0));
607 assertEquals("match_bitap: Fuzzy match #1.", 4, dmp.match_bitap("abcdefghijk", "efxhi", 0));
609 assertEquals("match_bitap: Fuzzy match #2.", 2, dmp.match_bitap("abcdefghijk", "cdefxyhijk", 5));
611 assertEquals("match_bitap: Fuzzy match #3.", -1, dmp.match_bitap("abcdefghijk", "bxy", 1));
613 assertEquals("match_bitap: Overflow.", 2, dmp.match_bitap("123456789xx0", "3456789x0", 2));
615 assertEquals("match_bitap: Before start match.", 0, dmp.match_bitap("abcdef", "xxabc", 4));
617 assertEquals("match_bitap: Beyond end match.", 3, dmp.match_bitap("abcdef", "defyy", 4));
619 assertEquals("match_bitap: Oversized pattern.", 0, dmp.match_bitap("abcdef", "xabcdefy", 0));
621 dmp.Match_Threshold = 0.4f;
622 assertEquals("match_bitap: Threshold #1.", 4, dmp.match_bitap("abcdefghijk", "efxyhi", 1));
624 dmp.Match_Threshold = 0.3f;
625 assertEquals("match_bitap: Threshold #2.", -1, dmp.match_bitap("abcdefghijk", "efxyhi", 1));
627 dmp.Match_Threshold = 0.0f;
628 assertEquals("match_bitap: Threshold #3.", 1, dmp.match_bitap("abcdefghijk", "bcdef", 1));
630 dmp.Match_Threshold = 0.5f;
631 assertEquals("match_bitap: Multiple select #1.", 0, dmp.match_bitap("abcdexyzabcde", "abccde", 3));
633 assertEquals("match_bitap: Multiple select #2.", 8, dmp.match_bitap("abcdexyzabcde", "abccde", 5));
635 dmp.Match_Distance = 10; // Strict location.
636 assertEquals("match_bitap: Distance test #1.", -1, dmp.match_bitap("abcdefghijklmnopqrstuvwxyz", "abcdefg", 24));
638 assertEquals("match_bitap: Distance test #2.", 0, dmp.match_bitap("abcdefghijklmnopqrstuvwxyz", "abcdxxefg", 1));
640 dmp.Match_Distance = 1000; // Loose location.
641 assertEquals("match_bitap: Distance test #3.", 0, dmp.match_bitap("abcdefghijklmnopqrstuvwxyz", "abcdefg", 24));
646 assertEquals("match_main: Equality.", 0, dmp.match_main("abcdef", "abcdef", 1000));
648 assertEquals("match_main: Null text.", -1, dmp.match_main("", "abcdef", 1));
650 assertEquals("match_main: Null pattern.", 3, dmp.match_main("abcdef", "", 3));
652 assertEquals("match_main: Exact match.", 3, dmp.match_main("abcdef", "de", 3));
654 dmp.match_main("abcdef", "defy", 4));
656 assertEquals("match_main: Oversized pattern.", 0, dmp.match_main("abcdef", "abcdefy", 0));
658 dmp.Match_Threshold = 0.7f;
659 assertEquals("match_main: Complex match.", 4, dmp.match_main("I am the very model of a modern major general.", " that berry ", 5));
660 dmp.Match_Threshold = 0.5f;
664 dmp.match_main(null, null, 0);
688 assertTrue("patch_fromText: #0.", dmp.patch_fromText("").isEmpty());
691 assertEquals("patch_fromText: #1.", strp, dmp.patch_fromText(strp).get(0).toString());
693 assertEquals("patch_fromText: #2.", "@@ -1 +1 @@\n-a\n+b\n", dmp.patch_fromText("@@ -1 +1 @@\n-a\n+b\n").get(0).toString());
695 assertEquals("patch_fromText: #3.", "@@ -1,3 +0,0 @@\n-abc\n", dmp.patch_fromText("@@ -1,3 +0,0 @@\n-abc\n").get(0).toString());
697 assertEquals("patch_fromText: #4.", "@@ -0,0 +1,3 @@\n+abc\n", dmp.patch_fromText("@@ -0,0 +1,3 @@\n+abc\n").get(0).toString());
701 dmp.patch_fromText("Bad\nPatch\n");
711 patches = dmp.patch_fromText(strp);
712 assertEquals("patch_toText: Single", strp, dmp.patch_toText(patches));
715 patches = dmp.patch_fromText(strp);
716 assertEquals("patch_toText: Dual", strp, dmp.patch_toText(patches));
720 dmp.Patch_Margin = 4;
722 p = dmp.patch_fromText("@@ -21,4 +21,10 @@\n-jump\n+somersault\n").get(0);
723 dmp.patch_addContext(p, "The quick brown fox jumps over the lazy dog.");
726 p = dmp.patch_fromText("@@ -21,4 +21,10 @@\n-jump\n+somersault\n").get(0);
727 dmp.patch_addContext(p, "The quick brown fox jumps.");
730 p = dmp.patch_fromText("@@ -3 +3,2 @@\n-e\n+at\n").get(0);
731 dmp.patch_addContext(p, "The quick brown fox jumps.");
734 p = dmp.patch_fromText("@@ -3 +3,2 @@\n-e\n+at\n").get(0);
735 dmp.patch_addContext(p, "The quick brown fox jumps. The quick brown fox crashes.");
746 patches = dmp.patch_make(text2, text1);
747 assertEquals("patch_make: Text2+Text1 inputs", expectedPatch, dmp.patch_toText(patches));
750 patches = dmp.patch_make(text1, text2);
751 assertEquals("patch_make: Text1+Text2 inputs", expectedPatch, dmp.patch_toText(patches));
753 LinkedList<Diff> diffs = dmp.diff_main(text1, text2, false);
754 patches = dmp.patch_make(diffs);
755 assertEquals("patch_make: Diff input", expectedPatch, dmp.patch_toText(patches));
757 patches = dmp.patch_make(text1, diffs);
758 assertEquals("patch_make: Text1+Diff inputs", expectedPatch, dmp.patch_toText(patches));
760 patches = dmp.patch_make(text1, text2, diffs);
761 assertEquals("patch_make: Text1+Text2+Diff inputs (deprecated)", expectedPatch, dmp.patch_toText(patches));
763 patches = dmp.patch_make("`1234567890-=[]\\;',./", "~!@#$%^&*()_+{}|:\"<>?");
764 assertEquals("patch_toText: Character encoding.", "@@ -1,21 +1,21 @@\n-%601234567890-=%5B%5D%5C;',./\n+~!@#$%25%5E&*()_+%7B%7D%7C:%22%3C%3E?\n", dmp.patch_toText(patches));
767 assertEquals("patch_fromText: Character decoding.", diffs, dmp.patch_fromText("@@ -1,21 +1,21 @@\n-%601234567890-=%5B%5D%5C;',./\n+~!@#$%25%5E&*()_+%7B%7D%7C:%22%3C%3E?\n").get(0).diffs);
775 patches = dmp.patch_make(text1, text2);
776 assertEquals("patch_make: Long string with repeats.", expectedPatch, dmp.patch_toText(patches));
780 dmp.patch_make(null);
790 patches = dmp.patch_make("abcdefghijklmnopqrstuvwxyz01234567890", "XabXcdXefXghXijXklXmnXopXqrXstXuvXwxXyzX01X23X45X67X89X0");
791 dmp.patch_splitMax(patches);
792 assertEquals("patch_splitMax: #1.", "@@ -1,32 +1,46 @@\n+X\n ab\n+X\n cd\n+X\n ef\n+X\n gh\n+X\n ij\n+X\n kl\n+X\n mn\n+X\n op\n+X\n qr\n+X\n st\n+X\n uv\n+X\n wx\n+X\n yz\n+X\n 012345\n@@ -25,13 +39,18 @@\n zX01\n+X\n 23\n+X\n 45\n+X\n 67\n+X\n 89\n+X\n 0\n", dmp.patch_toText(patches));
794 patches = dmp.patch_make("abcdef1234567890123456789012345678901234567890123456789012345678901234567890uvwxyz", "abcdefuvwxyz");
795 String oldToText = dmp.patch_toText(patches);
796 dmp.patch_splitMax(patches);
797 assertEquals("patch_splitMax: #2.", oldToText, dmp.patch_toText(patches));
799 patches = dmp.patch_make("1234567890123456789012345678901234567890123456789012345678901234567890", "abc");
800 dmp.patch_splitMax(patches);
801 assertEquals("patch_splitMax: #3.", "@@ -1,32 +1,4 @@\n-1234567890123456789012345678\n 9012\n@@ -29,32 +1,4 @@\n-9012345678901234567890123456\n 7890\n@@ -57,14 +1,3 @@\n-78901234567890\n+abc\n", dmp.patch_toText(patches));
803 patches = dmp.patch_make("abcdefghij , h : 0 , t : 1 abcdefghij , h : 0 , t : 1 abcdefghij , h : 0 , t : 1", "abcdefghij , h : 1 , t : 1 abcdefghij , h : 1 , t : 1 abcdefghij , h : 0 , t : 1");
804 dmp.patch_splitMax(patches);
805 assertEquals("patch_splitMax: #4.", "@@ -2,32 +2,32 @@\n bcdefghij , h : \n-0\n+1\n , t : 1 abcdef\n@@ -29,32 +29,32 @@\n bcdefghij , h : \n-0\n+1\n , t : 1 abcdef\n", dmp.patch_toText(patches));
810 patches = dmp.patch_make("", "test");
811 assertEquals("patch_addPadding: Both edges full.", "@@ -0,0 +1,4 @@\n+test\n", dmp.patch_toText(patches));
812 dmp.patch_addPadding(patches);
813 assertEquals("patch_addPadding: Both edges full.", "@@ -1,8 +1,12 @@\n %01%02%03%04\n+test\n %01%02%03%04\n", dmp.patch_toText(patches));
815 patches = dmp.patch_make("XY", "XtestY");
816 assertEquals("patch_addPadding: Both edges partial.", "@@ -1,2 +1,6 @@\n X\n+test\n Y\n", dmp.patch_toText(patches));
817 dmp.patch_addPadding(patches);
818 assertEquals("patch_addPadding: Both edges partial.", "@@ -2,8 +2,12 @@\n %02%03%04X\n+test\n Y%01%02%03\n", dmp.patch_toText(patches));
820 patches = dmp.patch_make("XXXXYYYY", "XXXXtestYYYY");
821 assertEquals("patch_addPadding: Both edges none.", "@@ -1,8 +1,12 @@\n XXXX\n+test\n YYYY\n", dmp.patch_toText(patches));
822 dmp.patch_addPadding(patches);
823 assertEquals("patch_addPadding: Both edges none.", "@@ -5,8 +5,12 @@\n XXXX\n+test\n YYYY\n", dmp.patch_toText(patches));
827 dmp.Match_Distance = 1000;
828 dmp.Match_Threshold = 0.5f;
829 dmp.Patch_DeleteThreshold = 0.5f;
831 patches = dmp.patch_make("The quick brown fox jumps over the lazy dog.", "That quick brown fox jumped over a lazy dog.");
832 Object[] results = dmp.patch_apply(patches, "The quick brown fox jumps over the lazy dog.");
837 results = dmp.patch_apply(patches, "The quick red rabbit jumps over the tired tiger.");
842 results = dmp.patch_apply(patches, "I am the very model of a modern major general.");
847 patches = dmp.patch_make("x1234567890123456789012345678901234567890123456789012345678901234567890y", "xabcy");
848 results = dmp.patch_apply(patches, "x123456789012345678901234567890-----++++++++++-----123456789012345678901234567890y");
853 patches = dmp.patch_make("x1234567890123456789012345678901234567890123456789012345678901234567890y", "xabcy");
854 results = dmp.patch_apply(patches, "x12345678901234567890---------------++++++++++---------------12345678901234567890y");
859 dmp.Patch_DeleteThreshold = 0.6f;
860 patches = dmp.patch_make("x1234567890123456789012345678901234567890123456789012345678901234567890y", "xabcy");
861 results = dmp.patch_apply(patches, "x12345678901234567890---------------++++++++++---------------12345678901234567890y");
865 dmp.Patch_DeleteThreshold = 0.5f;
868 dmp.Match_Threshold = 0.0f;
869 dmp.Match_Distance = 0;
870 patches = dmp.patch_make("abcdefghijklmnopqrstuvwxyz--------------------1234567890", "abcXXXXXXXXXXdefghijklmnopqrstuvwxyz--------------------1234567YYYYYYYYYY890");
871 results = dmp.patch_apply(patches, "ABCDEFGHIJKLMNOPQRSTUVWXYZ--------------------1234567890");
875 dmp.Match_Threshold = 0.5f;
876 dmp.Match_Distance = 1000;
878 patches = dmp.patch_make("", "test");
879 String patchStr = dmp.patch_toText(patches);
880 dmp.patch_apply(patches, "");
881 assertEquals("patch_apply: No side effects.", patchStr, dmp.patch_toText(patches));
883 patches = dmp.patch_make("The quick brown fox jumps over the lazy dog.", "Woof");
884 patchStr = dmp.patch_toText(patches);
885 dmp.patch_apply(patches, "The quick brown fox jumps over the lazy dog.");
886 assertEquals("patch_apply: No side effects with major delete.", patchStr, dmp.patch_toText(patches));
888 patches = dmp.patch_make("", "test");
889 results = dmp.patch_apply(patches, "");
894 patches = dmp.patch_make("XY", "XtestY");
895 results = dmp.patch_apply(patches, "XY");
900 patches = dmp.patch_make("y", "y123");
901 results = dmp.patch_apply(patches, "x");