public class CharEscapeTransformationTestCase extends AbstractTestCase {
private void match(String pattern, String test, String expectedValue) throws Exception {
REParser parser = new REParser(pattern);
CharEscapeTransformation escaper = new CharEscapeTransformation('/', '_');
RENode.Disjunction re = parser.parseDisjunction();
re.accept(escaper);
Pattern p = Pattern.compile(RERenderer.render(re, new StringBuilder()).toString());
Matcher matcher = p.matcher(test);
assertTrue(matcher.find());
assertEquals(expectedValue, matcher.group());