[apex] Add test case for #5333
This commit is contained in:
@ -66,4 +66,12 @@ class ApexCommentTest extends ApexParserTestBase {
|
||||
ASTFormalComment comment = file.descendants(ASTUserClass.class).children(ASTFormalComment.class).first();
|
||||
assertEquals(FORMAL_COMMENT_CONTENT, comment.getImage());
|
||||
}
|
||||
|
||||
@Test
|
||||
void fileWithUnicodeEscapes() {
|
||||
ASTApexFile file = apex.parse(FORMAL_COMMENT_CONTENT + "\n"
|
||||
+ "class MyClass { String s = 'Fran\\u00E7ois'; }");
|
||||
ASTFormalComment comment = file.descendants(ASTUserClass.class).children(ASTFormalComment.class).first();
|
||||
assertEquals(FORMAL_COMMENT_CONTENT, comment.getImage());
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,7 @@ class ApexLexerTest {
|
||||
@Test
|
||||
void testLexerUnicodeEscapes() {
|
||||
String s = "'Fran\\u00E7ois'";
|
||||
// note: with apex-parser 4.3.1, no errors are reported anymore
|
||||
assertEquals(2, getLexingErrors(CharStreams.fromString(s)));
|
||||
assertEquals(0, getLexingErrors(new CaseInsensitiveInputStream(CharStreams.fromString(s))));
|
||||
}
|
||||
@ -71,7 +72,7 @@ class ApexLexerTest {
|
||||
return errorListener.getErrorCount();
|
||||
}
|
||||
|
||||
static class ErrorListener extends BaseErrorListener {
|
||||
private static class ErrorListener extends BaseErrorListener {
|
||||
private int errorCount = 0;
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user