public void testExpression() { new ParserTester("").assertNotParseExpression(); new ParserTester("^").assertParseExpression("<^/>", 1); new ParserTester("^+").assertParseExpression("<+><^/></+>", 2); new ParserTester("$").assertParseExpression("<$/>", 1); new ParserTester("$+").assertParseExpression("<+><$/></+>", 2); new ParserTester("a").assertParseExpression("<c>a</c>", 1); new ParserTester("a+").assertParseExpression("<+><c>a</c></+>", 2); new ParserTester(".").assertParseExpression("<./>", 1); new ParserTester(".+").assertParseExpression("<+><./></+>", 2); new ParserTester("\\+").assertParseExpression("<c>+</c>", 2); new ParserTester("\\++").assertParseExpression("<+><c>+</c></+>", 3); new ParserTester("*").assertNotParseExpression(); new ParserTester("+").assertNotParseExpression(); new ParserTester("?").assertNotParseExpression(); new ParserTester("{").assertNotParseExpression(); new ParserTester("|").assertNotParseExpression(); }
public void testExpression() { new ParserTester("").assertNotParseExpression(); new ParserTester("^").assertParseExpression("<^/>", 1); new ParserTester("^+").assertParseExpression("<+><^/></+>", 2); new ParserTester("$").assertParseExpression("<$/>", 1); new ParserTester("$+").assertParseExpression("<+><$/></+>", 2); new ParserTester("a").assertParseExpression("<c>a</c>", 1); new ParserTester("a+").assertParseExpression("<+><c>a</c></+>", 2); new ParserTester(".").assertParseExpression("<./>", 1); new ParserTester(".+").assertParseExpression("<+><./></+>", 2); new ParserTester("\\+").assertParseExpression("<c>+</c>", 2); new ParserTester("\\++").assertParseExpression("<+><c>+</c></+>", 3); new ParserTester("*").assertNotParseExpression(); new ParserTester("+").assertNotParseExpression(); new ParserTester("?").assertNotParseExpression(); new ParserTester("{").assertNotParseExpression(); new ParserTester("|").assertNotParseExpression(); }
public void testGroup() { new ParserTester("(a)").assertParseExpression("<(><c>a</c></(>", 3); new ParserTester("(a(b)c)").assertParseExpression("<(><c>a</c><(><c>b</c></(><c>c</c></(>", 7); new ParserTester("(?:a)").assertParseExpression("<(?:><c>a</c></(?:>", 5); new ParserTester("(?=a)").assertParseExpression("<(?=><c>a</c></(?=>", 5); new ParserTester("(?!a)").assertParseExpression("<(?!><c>a</c></(?!>", 5); new ParserTester("(?<=a)").assertParseExpression("<(?<=><c>a</c></(?<=>", 6); new ParserTester("(?<!a)").assertParseExpression("<(?<!><c>a</c></(?<!>", 6); new ParserTester("(?)").assertParseExpression("<(><c>?</c></(>", 3); new ParserTester("(?_)").assertNotParseExpression(); new ParserTester("(?<_)").assertNotParseExpression(); }
public void testGroup() { new ParserTester("(a)").assertParseExpression("<(><c>a</c></(>", 3); new ParserTester("(a(b)c)").assertParseExpression("<(><c>a</c><(><c>b</c></(><c>c</c></(>", 7); new ParserTester("(?:a)").assertParseExpression("<(?:><c>a</c></(?:>", 5); new ParserTester("(?=a)").assertParseExpression("<(?=><c>a</c></(?=>", 5); new ParserTester("(?!a)").assertParseExpression("<(?!><c>a</c></(?!>", 5); new ParserTester("(?<=a)").assertParseExpression("<(?<=><c>a</c></(?<=>", 6); new ParserTester("(?<!a)").assertParseExpression("<(?<!><c>a</c></(?<!>", 6); new ParserTester("(?)").assertParseExpression("<(><c>?</c></(>", 3); new ParserTester("(?_)").assertNotParseExpression(); new ParserTester("(?<_)").assertNotParseExpression(); }