Remove System.out.println from RevWalkFilterTest
[egit/qmx.git] / org.spearce.jgit.test / tst / org / spearce / jgit / fnmatch / FileNameMatcherTest.java
blob0c9501b26381d044e954158d5baec5c3d2f52bd7
1 /*
2 * Copyright (C) 2008, Florian Köberle <florianskarten@web.de>
4 * All rights reserved.
6 * Redistribution and use in source and binary forms, with or
7 * without modification, are permitted provided that the following
8 * conditions are met:
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * - Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
18 * - Neither the name of the Git Development Community nor the
19 * names of its contributors may be used to endorse or promote
20 * products derived from this software without specific prior
21 * written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
24 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
25 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
28 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
33 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
35 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 package org.spearce.jgit.fnmatch;
40 import org.spearce.jgit.errors.InvalidPatternException;
41 import org.spearce.jgit.fnmatch.FileNameMatcher;
43 import junit.framework.TestCase;
45 public class FileNameMatcherTest extends TestCase {
47 private void assertMatch(final String pattern, final String input,
48 final boolean matchExpected, final boolean appendCanMatchExpected)
49 throws InvalidPatternException {
50 final FileNameMatcher matcher = new FileNameMatcher(pattern, null);
51 matcher.append(input);
52 assertEquals(matchExpected, matcher.isMatch());
53 assertEquals(appendCanMatchExpected, matcher.canAppendMatch());
56 private void assertFileNameMatch(final String pattern, final String input,
57 final char excludedCharacter, final boolean matchExpected,
58 final boolean appendCanMatchExpected)
59 throws InvalidPatternException {
60 final FileNameMatcher matcher = new FileNameMatcher(pattern,
61 new Character(excludedCharacter));
62 matcher.append(input);
63 assertEquals(matchExpected, matcher.isMatch());
64 assertEquals(appendCanMatchExpected, matcher.canAppendMatch());
67 public void testVerySimplePatternCase0() throws Exception {
68 assertMatch("", "", true, false);
71 public void testVerySimplePatternCase1() throws Exception {
72 assertMatch("ab", "a", false, true);
75 public void testVerySimplePatternCase2() throws Exception {
76 assertMatch("ab", "ab", true, false);
79 public void testVerySimplePatternCase3() throws Exception {
80 assertMatch("ab", "ac", false, false);
83 public void testVerySimplePatternCase4() throws Exception {
84 assertMatch("ab", "abc", false, false);
87 public void testVerySimpleWirdcardCase0() throws Exception {
88 assertMatch("?", "a", true, false);
91 public void testVerySimpleWildCardCase1() throws Exception {
92 assertMatch("??", "a", false, true);
95 public void testVerySimpleWildCardCase2() throws Exception {
96 assertMatch("??", "ab", true, false);
99 public void testVerySimpleWildCardCase3() throws Exception {
100 assertMatch("??", "abc", false, false);
103 public void testVerySimpleStarCase0() throws Exception {
104 assertMatch("*", "", true, true);
107 public void testVerySimpleStarCase1() throws Exception {
108 assertMatch("*", "a", true, true);
111 public void testVerySimpleStarCase2() throws Exception {
112 assertMatch("*", "ab", true, true);
115 public void testSimpleStarCase0() throws Exception {
116 assertMatch("a*b", "a", false, true);
119 public void testSimpleStarCase1() throws Exception {
120 assertMatch("a*c", "ac", true, true);
123 public void testSimpleStarCase2() throws Exception {
124 assertMatch("a*c", "ab", false, true);
127 public void testSimpleStarCase3() throws Exception {
128 assertMatch("a*c", "abc", true, true);
131 public void testManySolutionsCase0() throws Exception {
132 assertMatch("a*a*a", "aaa", true, true);
135 public void testManySolutionsCase1() throws Exception {
136 assertMatch("a*a*a", "aaaa", true, true);
139 public void testManySolutionsCase2() throws Exception {
140 assertMatch("a*a*a", "ababa", true, true);
143 public void testManySolutionsCase3() throws Exception {
144 assertMatch("a*a*a", "aaaaaaaa", true, true);
147 public void testManySolutionsCase4() throws Exception {
148 assertMatch("a*a*a", "aaaaaaab", false, true);
151 public void testVerySimpleGroupCase0() throws Exception {
152 assertMatch("[ab]", "a", true, false);
155 public void testVerySimpleGroupCase1() throws Exception {
156 assertMatch("[ab]", "b", true, false);
159 public void testVerySimpleGroupCase2() throws Exception {
160 assertMatch("[ab]", "ab", false, false);
163 public void testVerySimpleGroupRangeCase0() throws Exception {
164 assertMatch("[b-d]", "a", false, false);
167 public void testVerySimpleGroupRangeCase1() throws Exception {
168 assertMatch("[b-d]", "b", true, false);
171 public void testVerySimpleGroupRangeCase2() throws Exception {
172 assertMatch("[b-d]", "c", true, false);
175 public void testVerySimpleGroupRangeCase3() throws Exception {
176 assertMatch("[b-d]", "d", true, false);
179 public void testVerySimpleGroupRangeCase4() throws Exception {
180 assertMatch("[b-d]", "e", false, false);
183 public void testVerySimpleGroupRangeCase5() throws Exception {
184 assertMatch("[b-d]", "-", false, false);
187 public void testTwoGroupsCase0() throws Exception {
188 assertMatch("[b-d][ab]", "bb", true, false);
191 public void testTwoGroupsCase1() throws Exception {
192 assertMatch("[b-d][ab]", "ca", true, false);
195 public void testTwoGroupsCase2() throws Exception {
196 assertMatch("[b-d][ab]", "fa", false, false);
199 public void testTwoGroupsCase3() throws Exception {
200 assertMatch("[b-d][ab]", "bc", false, false);
203 public void testTwoRangesInOneGroupCase0() throws Exception {
204 assertMatch("[b-ce-e]", "a", false, false);
207 public void testTwoRangesInOneGroupCase1() throws Exception {
208 assertMatch("[b-ce-e]", "b", true, false);
211 public void testTwoRangesInOneGroupCase2() throws Exception {
212 assertMatch("[b-ce-e]", "c", true, false);
215 public void testTwoRangesInOneGroupCase3() throws Exception {
216 assertMatch("[b-ce-e]", "d", false, false);
219 public void testTwoRangesInOneGroupCase4() throws Exception {
220 assertMatch("[b-ce-e]", "e", true, false);
223 public void testTwoRangesInOneGroupCase5() throws Exception {
224 assertMatch("[b-ce-e]", "f", false, false);
227 public void testIncompleteRangesInOneGroupCase0() throws Exception {
228 assertMatch("a[b-]", "ab", true, false);
231 public void testIncompleteRangesInOneGroupCase1() throws Exception {
232 assertMatch("a[b-]", "ac", false, false);
235 public void testIncompleteRangesInOneGroupCase2() throws Exception {
236 assertMatch("a[b-]", "a-", true, false);
239 public void testCombinedRangesInOneGroupCase0() throws Exception {
240 assertMatch("[a-c-e]", "b", true, false);
244 * The c belongs to the range a-c. "-e" is no valid range so d should not
245 * match.
247 * @throws Exception
248 * for some reasons
250 public void testCombinedRangesInOneGroupCase1() throws Exception {
251 assertMatch("[a-c-e]", "d", false, false);
254 public void testCombinedRangesInOneGroupCase2() throws Exception {
255 assertMatch("[a-c-e]", "e", true, false);
258 public void testInversedGroupCase0() throws Exception {
259 assertMatch("[!b-c]", "a", true, false);
262 public void testInversedGroupCase1() throws Exception {
263 assertMatch("[!b-c]", "b", false, false);
266 public void testInversedGroupCase2() throws Exception {
267 assertMatch("[!b-c]", "c", false, false);
270 public void testInversedGroupCase3() throws Exception {
271 assertMatch("[!b-c]", "d", true, false);
274 public void testAlphaGroupCase0() throws Exception {
275 assertMatch("[[:alpha:]]", "d", true, false);
278 public void testAlphaGroupCase1() throws Exception {
279 assertMatch("[[:alpha:]]", ":", false, false);
282 public void testAlphaGroupCase2() throws Exception {
283 // \u00f6 = 'o' with dots on it
284 assertMatch("[[:alpha:]]", "\u00f6", true, false);
287 public void test2AlphaGroupsCase0() throws Exception {
288 // \u00f6 = 'o' with dots on it
289 assertMatch("[[:alpha:]][[:alpha:]]", "a\u00f6", true, false);
290 assertMatch("[[:alpha:]][[:alpha:]]", "a1", false, false);
293 public void testAlnumGroupCase0() throws Exception {
294 assertMatch("[[:alnum:]]", "a", true, false);
297 public void testAlnumGroupCase1() throws Exception {
298 assertMatch("[[:alnum:]]", "1", true, false);
301 public void testAlnumGroupCase2() throws Exception {
302 assertMatch("[[:alnum:]]", ":", false, false);
305 public void testBlankGroupCase0() throws Exception {
306 assertMatch("[[:blank:]]", " ", true, false);
309 public void testBlankGroupCase1() throws Exception {
310 assertMatch("[[:blank:]]", "\t", true, false);
313 public void testBlankGroupCase2() throws Exception {
314 assertMatch("[[:blank:]]", "\r", false, false);
317 public void testBlankGroupCase3() throws Exception {
318 assertMatch("[[:blank:]]", "\n", false, false);
321 public void testBlankGroupCase4() throws Exception {
322 assertMatch("[[:blank:]]", "a", false, false);
325 public void testCntrlGroupCase0() throws Exception {
326 assertMatch("[[:cntrl:]]", "a", false, false);
329 public void testCntrlGroupCase1() throws Exception {
330 assertMatch("[[:cntrl:]]", String.valueOf((char) 7), true, false);
333 public void testDigitGroupCase0() throws Exception {
334 assertMatch("[[:digit:]]", "0", true, false);
337 public void testDigitGroupCase1() throws Exception {
338 assertMatch("[[:digit:]]", "5", true, false);
341 public void testDigitGroupCase2() throws Exception {
342 assertMatch("[[:digit:]]", "9", true, false);
345 public void testDigitGroupCase3() throws Exception {
346 // \u06f9 = EXTENDED ARABIC-INDIC DIGIT NINE
347 assertMatch("[[:digit:]]", "\u06f9", true, false);
350 public void testDigitGroupCase4() throws Exception {
351 assertMatch("[[:digit:]]", "a", false, false);
354 public void testDigitGroupCase5() throws Exception {
355 assertMatch("[[:digit:]]", "]", false, false);
358 public void testGraphGroupCase0() throws Exception {
359 assertMatch("[[:graph:]]", "]", true, false);
362 public void testGraphGroupCase1() throws Exception {
363 assertMatch("[[:graph:]]", "a", true, false);
366 public void testGraphGroupCase2() throws Exception {
367 assertMatch("[[:graph:]]", ".", true, false);
370 public void testGraphGroupCase3() throws Exception {
371 assertMatch("[[:graph:]]", "0", true, false);
374 public void testGraphGroupCase4() throws Exception {
375 assertMatch("[[:graph:]]", " ", false, false);
378 public void testGraphGroupCase5() throws Exception {
379 // \u00f6 = 'o' with dots on it
380 assertMatch("[[:graph:]]", "\u00f6", true, false);
383 public void testLowerGroupCase0() throws Exception {
384 assertMatch("[[:lower:]]", "a", true, false);
387 public void testLowerGroupCase1() throws Exception {
388 assertMatch("[[:lower:]]", "h", true, false);
391 public void testLowerGroupCase2() throws Exception {
392 assertMatch("[[:lower:]]", "A", false, false);
395 public void testLowerGroupCase3() throws Exception {
396 assertMatch("[[:lower:]]", "H", false, false);
399 public void testLowerGroupCase4() throws Exception {
400 // \u00e4 = small 'a' with dots on it
401 assertMatch("[[:lower:]]", "\u00e4", true, false);
404 public void testLowerGroupCase5() throws Exception {
405 assertMatch("[[:lower:]]", ".", false, false);
408 public void testPrintGroupCase0() throws Exception {
409 assertMatch("[[:print:]]", "]", true, false);
412 public void testPrintGroupCase1() throws Exception {
413 assertMatch("[[:print:]]", "a", true, false);
416 public void testPrintGroupCase2() throws Exception {
417 assertMatch("[[:print:]]", ".", true, false);
420 public void testPrintGroupCase3() throws Exception {
421 assertMatch("[[:print:]]", "0", true, false);
424 public void testPrintGroupCase4() throws Exception {
425 assertMatch("[[:print:]]", " ", true, false);
428 public void testPrintGroupCase5() throws Exception {
429 // \u00f6 = 'o' with dots on it
430 assertMatch("[[:print:]]", "\u00f6", true, false);
433 public void testPunctGroupCase0() throws Exception {
434 assertMatch("[[:punct:]]", ".", true, false);
437 public void testPunctGroupCase1() throws Exception {
438 assertMatch("[[:punct:]]", "@", true, false);
441 public void testPunctGroupCase2() throws Exception {
442 assertMatch("[[:punct:]]", " ", false, false);
445 public void testPunctGroupCase3() throws Exception {
446 assertMatch("[[:punct:]]", "a", false, false);
449 public void testSpaceGroupCase0() throws Exception {
450 assertMatch("[[:space:]]", " ", true, false);
453 public void testSpaceGroupCase1() throws Exception {
454 assertMatch("[[:space:]]", "\t", true, false);
457 public void testSpaceGroupCase2() throws Exception {
458 assertMatch("[[:space:]]", "\r", true, false);
461 public void testSpaceGroupCase3() throws Exception {
462 assertMatch("[[:space:]]", "\n", true, false);
465 public void testSpaceGroupCase4() throws Exception {
466 assertMatch("[[:space:]]", "a", false, false);
469 public void testUpperGroupCase0() throws Exception {
470 assertMatch("[[:upper:]]", "a", false, false);
473 public void testUpperGroupCase1() throws Exception {
474 assertMatch("[[:upper:]]", "h", false, false);
477 public void testUpperGroupCase2() throws Exception {
478 assertMatch("[[:upper:]]", "A", true, false);
481 public void testUpperGroupCase3() throws Exception {
482 assertMatch("[[:upper:]]", "H", true, false);
485 public void testUpperGroupCase4() throws Exception {
486 // \u00c4 = 'A' with dots on it
487 assertMatch("[[:upper:]]", "\u00c4", true, false);
490 public void testUpperGroupCase5() throws Exception {
491 assertMatch("[[:upper:]]", ".", false, false);
494 public void testXDigitGroupCase0() throws Exception {
495 assertMatch("[[:xdigit:]]", "a", true, false);
498 public void testXDigitGroupCase1() throws Exception {
499 assertMatch("[[:xdigit:]]", "d", true, false);
502 public void testXDigitGroupCase2() throws Exception {
503 assertMatch("[[:xdigit:]]", "f", true, false);
506 public void testXDigitGroupCase3() throws Exception {
507 assertMatch("[[:xdigit:]]", "0", true, false);
510 public void testXDigitGroupCase4() throws Exception {
511 assertMatch("[[:xdigit:]]", "5", true, false);
514 public void testXDigitGroupCase5() throws Exception {
515 assertMatch("[[:xdigit:]]", "9", true, false);
518 public void testXDigitGroupCase6() throws Exception {
519 assertMatch("[[:xdigit:]]", "۹", false, false);
522 public void testXDigitGroupCase7() throws Exception {
523 assertMatch("[[:xdigit:]]", ".", false, false);
526 public void testWordroupCase0() throws Exception {
527 assertMatch("[[:word:]]", "g", true, false);
530 public void testWordroupCase1() throws Exception {
531 // \u00f6 = 'o' with dots on it
532 assertMatch("[[:word:]]", "\u00f6", true, false);
535 public void testWordroupCase2() throws Exception {
536 assertMatch("[[:word:]]", "5", true, false);
539 public void testWordroupCase3() throws Exception {
540 assertMatch("[[:word:]]", "_", true, false);
543 public void testWordroupCase4() throws Exception {
544 assertMatch("[[:word:]]", " ", false, false);
547 public void testWordroupCase5() throws Exception {
548 assertMatch("[[:word:]]", ".", false, false);
551 public void testMixedGroupCase0() throws Exception {
552 assertMatch("[A[:lower:]C3-5]", "A", true, false);
555 public void testMixedGroupCase1() throws Exception {
556 assertMatch("[A[:lower:]C3-5]", "C", true, false);
559 public void testMixedGroupCase2() throws Exception {
560 assertMatch("[A[:lower:]C3-5]", "e", true, false);
563 public void testMixedGroupCase3() throws Exception {
564 assertMatch("[A[:lower:]C3-5]", "3", true, false);
567 public void testMixedGroupCase4() throws Exception {
568 assertMatch("[A[:lower:]C3-5]", "4", true, false);
571 public void testMixedGroupCase5() throws Exception {
572 assertMatch("[A[:lower:]C3-5]", "5", true, false);
575 public void testMixedGroupCase6() throws Exception {
576 assertMatch("[A[:lower:]C3-5]", "B", false, false);
579 public void testMixedGroupCase7() throws Exception {
580 assertMatch("[A[:lower:]C3-5]", "2", false, false);
583 public void testMixedGroupCase8() throws Exception {
584 assertMatch("[A[:lower:]C3-5]", "6", false, false);
587 public void testMixedGroupCase9() throws Exception {
588 assertMatch("[A[:lower:]C3-5]", ".", false, false);
591 public void testSpecialGroupCase0() throws Exception {
592 assertMatch("[[]", "[", true, false);
595 public void testSpecialGroupCase1() throws Exception {
596 assertMatch("[]]", "]", true, false);
599 public void testSpecialGroupCase2() throws Exception {
600 assertMatch("[]a]", "]", true, false);
603 public void testSpecialGroupCase3() throws Exception {
604 assertMatch("[a[]", "[", true, false);
607 public void testSpecialGroupCase4() throws Exception {
608 assertMatch("[a[]", "a", true, false);
611 public void testSpecialGroupCase5() throws Exception {
612 assertMatch("[!]]", "]", false, false);
615 public void testSpecialGroupCase6() throws Exception {
616 assertMatch("[!]]", "x", true, false);
619 public void testSpecialGroupCase7() throws Exception {
620 assertMatch("[:]]", ":]", true, false);
623 public void testSpecialGroupCase8() throws Exception {
624 assertMatch("[:]]", ":", false, true);
627 public void testSpecialGroupCase9() throws Exception {
628 try {
629 assertMatch("[[:]", ":", true, true);
630 fail("InvalidPatternException expected");
631 } catch (InvalidPatternException e) {
632 // expected
636 public void testUnsupportedGroupCase0() throws Exception {
637 try {
638 assertMatch("[[=a=]]", "b", false, false);
639 fail("InvalidPatternException expected");
640 } catch (InvalidPatternException e) {
641 assertTrue(e.getMessage().contains("[=a=]"));
645 public void testUnsupportedGroupCase1() throws Exception {
646 try {
647 assertMatch("[[.a.]]", "b", false, false);
648 fail("InvalidPatternException expected");
649 } catch (InvalidPatternException e) {
650 assertTrue(e.getMessage().contains("[.a.]"));
654 public void testFilePathSimpleCase() throws Exception {
655 assertFileNameMatch("a/b", "a/b", '/', true, false);
658 public void testFilePathCase0() throws Exception {
659 assertFileNameMatch("a*b", "a/b", '/', false, false);
662 public void testFilePathCase1() throws Exception {
663 assertFileNameMatch("a?b", "a/b", '/', false, false);
666 public void testFilePathCase2() throws Exception {
667 assertFileNameMatch("a*b", "a\\b", '\\', false, false);
670 public void testFilePathCase3() throws Exception {
671 assertFileNameMatch("a?b", "a\\b", '\\', false, false);
674 public void testReset() throws Exception {
675 final String pattern = "helloworld";
676 final FileNameMatcher matcher = new FileNameMatcher(pattern, null);
677 matcher.append("helloworld");
678 assertEquals(true, matcher.isMatch());
679 assertEquals(false, matcher.canAppendMatch());
680 matcher.reset();
681 matcher.append("hello");
682 assertEquals(false, matcher.isMatch());
683 assertEquals(true, matcher.canAppendMatch());
684 matcher.append("world");
685 assertEquals(true, matcher.isMatch());
686 assertEquals(false, matcher.canAppendMatch());
687 matcher.append("to much");
688 assertEquals(false, matcher.isMatch());
689 assertEquals(false, matcher.canAppendMatch());
690 matcher.reset();
691 matcher.append("helloworld");
692 assertEquals(true, matcher.isMatch());
693 assertEquals(false, matcher.canAppendMatch());
696 public void testCreateMatcherForSuffix() throws Exception {
697 final String pattern = "helloworld";
698 final FileNameMatcher matcher = new FileNameMatcher(pattern, null);
699 matcher.append("hello");
700 final FileNameMatcher childMatcher = matcher.createMatcherForSuffix();
701 assertEquals(false, matcher.isMatch());
702 assertEquals(true, matcher.canAppendMatch());
703 assertEquals(false, childMatcher.isMatch());
704 assertEquals(true, childMatcher.canAppendMatch());
705 matcher.append("world");
706 assertEquals(true, matcher.isMatch());
707 assertEquals(false, matcher.canAppendMatch());
708 assertEquals(false, childMatcher.isMatch());
709 assertEquals(true, childMatcher.canAppendMatch());
710 childMatcher.append("world");
711 assertEquals(true, matcher.isMatch());
712 assertEquals(false, matcher.canAppendMatch());
713 assertEquals(true, childMatcher.isMatch());
714 assertEquals(false, childMatcher.canAppendMatch());
715 childMatcher.reset();
716 assertEquals(true, matcher.isMatch());
717 assertEquals(false, matcher.canAppendMatch());
718 assertEquals(false, childMatcher.isMatch());
719 assertEquals(true, childMatcher.canAppendMatch());
720 childMatcher.append("world");
721 assertEquals(true, matcher.isMatch());
722 assertEquals(false, matcher.canAppendMatch());
723 assertEquals(true, childMatcher.isMatch());
724 assertEquals(false, childMatcher.canAppendMatch());
727 public void testCopyConstructor() throws Exception {
728 final String pattern = "helloworld";
729 final FileNameMatcher matcher = new FileNameMatcher(pattern, null);
730 matcher.append("hello");
731 final FileNameMatcher copy = new FileNameMatcher(matcher);
732 assertEquals(false, matcher.isMatch());
733 assertEquals(true, matcher.canAppendMatch());
734 assertEquals(false, copy.isMatch());
735 assertEquals(true, copy.canAppendMatch());
736 matcher.append("world");
737 assertEquals(true, matcher.isMatch());
738 assertEquals(false, matcher.canAppendMatch());
739 assertEquals(false, copy.isMatch());
740 assertEquals(true, copy.canAppendMatch());
741 copy.append("world");
742 assertEquals(true, matcher.isMatch());
743 assertEquals(false, matcher.canAppendMatch());
744 assertEquals(true, copy.isMatch());
745 assertEquals(false, copy.canAppendMatch());
746 copy.reset();
747 assertEquals(true, matcher.isMatch());
748 assertEquals(false, matcher.canAppendMatch());
749 assertEquals(false, copy.isMatch());
750 assertEquals(true, copy.canAppendMatch());
751 copy.append("helloworld");
752 assertEquals(true, matcher.isMatch());
753 assertEquals(false, matcher.canAppendMatch());
754 assertEquals(true, copy.isMatch());
755 assertEquals(false, copy.canAppendMatch());