@Test public void testQuotesAndParen() throws InvalidPatternException { List<String> result; SpecialistGlobExpander special = new SpecialistGlobExpander(true, PhraseTreatment.INTERIOR_EXPANDABLE, PhraseTreatment.INTERIOR_NOT_EXPANDABLE); result = special.expand("\"{hello,goodbye}{1-2,({3-4}),(\")}\""); assertEquals(8, result.size()); assertTrue(result.contains("\"goodbye2\"")); assertTrue(result.contains("\"hello({3-4})\"")); assertTrue(result.contains("\"goodbye(\")\"")); }
@Test public void testParen() throws InvalidPatternException { List<String> result; SpecialistGlobExpander notSpecial = new SpecialistGlobExpander(true, PhraseTreatment.NOT_A_SPECIAL_CHAR, PhraseTreatment.NOT_A_SPECIAL_CHAR); result = notSpecial.expand("hello ({1-3})"); assertEquals(3, result.size()); assertEquals("hello (1)", result.get(0)); SpecialistGlobExpander expanding = new SpecialistGlobExpander(true, PhraseTreatment.INTERIOR_NOT_EXPANDABLE, PhraseTreatment.INTERIOR_EXPANDABLE); result = expanding.expand("hello ({1-3})"); assertEquals(3, result.size()); assertEquals("hello (2)", result.get(1)); SpecialistGlobExpander notExpanding = new SpecialistGlobExpander(true, PhraseTreatment.INTERIOR_EXPANDABLE, PhraseTreatment.INTERIOR_NOT_EXPANDABLE); result = notExpanding.expand("hello ({1,2-3})"); assertEquals(1, result.size());
@Test public void testQuotes() throws InvalidPatternException { List<String> result; SpecialistGlobExpander notSpecial = new SpecialistGlobExpander(true, PhraseTreatment.NOT_A_SPECIAL_CHAR, PhraseTreatment.NOT_A_SPECIAL_CHAR); result = notSpecial.expand("hello \"{1-3}\""); assertEquals(3, result.size()); assertEquals("hello \"1\"", result.get(0)); SpecialistGlobExpander expanding = new SpecialistGlobExpander(true, PhraseTreatment.INTERIOR_EXPANDABLE, PhraseTreatment.NOT_A_SPECIAL_CHAR); result = expanding.expand("hello \"{1-3}\""); assertEquals(3, result.size()); assertEquals("hello \"2\"", result.get(1)); SpecialistGlobExpander notExpanding = new SpecialistGlobExpander(true, PhraseTreatment.INTERIOR_NOT_EXPANDABLE, PhraseTreatment.NOT_A_SPECIAL_CHAR); result = notExpanding.expand("hello \"{1,2-3}\""); assertEquals(1, result.size());
private SpecialistGlobExpander newGlobExpander() { return new SpecialistGlobExpander(true, PhraseTreatment.NOT_A_SPECIAL_CHAR, PhraseTreatment.NOT_A_SPECIAL_CHAR); }