From 2ec285735e7448a42b48071d7e14760858fc1a80 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Tue, 27 May 2014 17:45:57 +0400 Subject: [PATCH] Test for EA-41250 - E: _JetLexer.zzScanError - Could not match input --- compiler/testData/psi/BackslashInString.kt | 3 +++ compiler/testData/psi/BackslashInString.txt | 22 +++++++++++++++++++ .../jet/parsing/JetParsingTestGenerated.java | 5 +++++ 3 files changed, 30 insertions(+) create mode 100644 compiler/testData/psi/BackslashInString.kt create mode 100644 compiler/testData/psi/BackslashInString.txt diff --git a/compiler/testData/psi/BackslashInString.kt b/compiler/testData/psi/BackslashInString.kt new file mode 100644 index 00000000000..b39bb2c32b5 --- /dev/null +++ b/compiler/testData/psi/BackslashInString.kt @@ -0,0 +1,3 @@ +fun foo() { + "\ +} diff --git a/compiler/testData/psi/BackslashInString.txt b/compiler/testData/psi/BackslashInString.txt new file mode 100644 index 00000000000..c652e0c4faa --- /dev/null +++ b/compiler/testData/psi/BackslashInString.txt @@ -0,0 +1,22 @@ +JetFile: BackslashInString.kt + PACKAGE_DIRECTIVE + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiErrorElement:Unexpected token in a string template + PsiElement(BAD_CHARACTER)('\') + PsiErrorElement:Expecting '"' + + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/parsing/JetParsingTestGenerated.java b/compiler/tests/org/jetbrains/jet/parsing/JetParsingTestGenerated.java index b170b9bcb3c..5354505a960 100644 --- a/compiler/tests/org/jetbrains/jet/parsing/JetParsingTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/parsing/JetParsingTestGenerated.java @@ -84,6 +84,11 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest { doParsingTest("compiler/testData/psi/BabySteps_ERR.kt"); } + @TestMetadata("BackslashInString.kt") + public void testBackslashInString() throws Exception { + doParsingTest("compiler/testData/psi/BackslashInString.kt"); + } + @TestMetadata("BlockCommentAtBeginningOfFile1.kt") public void testBlockCommentAtBeginningOfFile1() throws Exception { doParsingTest("compiler/testData/psi/BlockCommentAtBeginningOfFile1.kt");