}
}
public void testConsumeEscapedChar() throws ParseException {
ParserUtils parser = new ParserUtils("\\n"); //$NON-NLS-1$
assertEquals(2, parser.consumeEscapedChar());
parser = new ParserUtils("\\r"); //$NON-NLS-1$
assertEquals(2, parser.consumeEscapedChar());
parser = new ParserUtils("\\t"); //$NON-NLS-1$
assertEquals(2, parser.consumeEscapedChar());
parser = new ParserUtils("\\r"); //$NON-NLS-1$
assertEquals(2, parser.consumeEscapedChar());
parser = new ParserUtils("\\f"); //$NON-NLS-1$
assertEquals(2, parser.consumeEscapedChar());
parser = new ParserUtils("\\b"); //$NON-NLS-1$
assertEquals(2, parser.consumeEscapedChar());
parser = new ParserUtils("\\l"); //$NON-NLS-1$
assertEquals(2, parser.consumeEscapedChar());
parser = new ParserUtils("\\a"); //$NON-NLS-1$
assertEquals(2, parser.consumeEscapedChar());
parser = new ParserUtils("\\\\"); //$NON-NLS-1$
assertEquals(2, parser.consumeEscapedChar());
parser = new ParserUtils("\\'"); //$NON-NLS-1$
assertEquals(2, parser.consumeEscapedChar());
parser = new ParserUtils("\\\""); //$NON-NLS-1$
assertEquals(2, parser.consumeEscapedChar());
parser = new ParserUtils("\\$"); //$NON-NLS-1$
assertEquals(2, parser.consumeEscapedChar());
parser = new ParserUtils("\\{"); //$NON-NLS-1$
assertEquals(2, parser.consumeEscapedChar());
parser = new ParserUtils("\\x0"); //$NON-NLS-1$
assertEquals(3, parser.consumeEscapedChar());
parser = new ParserUtils("\\xa"); //$NON-NLS-1$
assertEquals(3, parser.consumeEscapedChar());
parser = new ParserUtils("\\xA"); //$NON-NLS-1$
assertEquals(3, parser.consumeEscapedChar());
parser = new ParserUtils("\\xf"); //$NON-NLS-1$
assertEquals(3, parser.consumeEscapedChar());
parser = new ParserUtils("\\xF"); //$NON-NLS-1$
assertEquals(3, parser.consumeEscapedChar());
parser = new ParserUtils(""); //$NON-NLS-1$
try {
parser.consumeEscapedChar();
fail("ParseException expected"); //$NON-NLS-1$
} catch (ParseException expected) {
}
parser = new ParserUtils("123"); //$NON-NLS-1$
try {
parser.consumeEscapedChar();
fail("ParseException expected"); //$NON-NLS-1$
} catch (ParseException expected) {
}
parser = new ParserUtils(" "); //$NON-NLS-1$
try {
parser.consumeEscapedChar();
fail("ParseException expected"); //$NON-NLS-1$
} catch (ParseException expected) {
}
parser = new ParserUtils("\\"); //$NON-NLS-1$
try {
parser.consumeEscapedChar();
fail("ParseException expected"); //$NON-NLS-1$
} catch (ParseException expected) {
}
parser = new ParserUtils("\\ "); //$NON-NLS-1$
try {
parser.consumeEscapedChar();
fail("ParseException expected"); //$NON-NLS-1$
} catch (ParseException expected) {
}
parser = new ParserUtils("\\x"); //$NON-NLS-1$
try {
parser.consumeEscapedChar();
fail("ParseException expected"); //$NON-NLS-1$
} catch (ParseException expected) {
}
parser = new ParserUtils("\\x "); //$NON-NLS-1$
try {
parser.consumeEscapedChar();
fail("ParseException expected"); //$NON-NLS-1$
} catch (ParseException expected) {
}
}