From 9a61998fca9af8936cb89019bfe203afc28faaab Mon Sep 17 00:00:00 2001 From: "victor.petukhov" Date: Thu, 25 Oct 2018 18:58:43 +0300 Subject: [PATCH] Add lexer test runner and whitespace characters tests Whitespace characters for the tests are U+000B, U+000C, U+000D, U+0085, U+2028, U+2029 --- .../{kdoc/lexer => lexer/kdoc}/codeBlocks.kt | 0 .../{kdoc/lexer => lexer/kdoc}/codeBlocks.txt | 0 .../kdoc}/codeBlocksWithVerticalTabs.kt | 0 .../kdoc}/codeBlocksWithVerticalTabs.txt | 0 .../carriageReturn/carriageReturn.kt | 1 + .../carriageReturn/carriageReturn.txt | 15 ++ .../carriageReturnInComments.kt | 12 + .../carriageReturnInComments.txt | 25 +++ .../carriageReturnInStringLiterals.kt | 17 ++ .../carriageReturnInStringLiterals.txt | 109 +++++++++ .../lineSeparator/lineSeparator.kt | 3 + .../lineSeparator/lineSeparator.txt | 17 ++ .../lineSeparator/lineSeparatorInComments.kt | 12 + .../lineSeparator/lineSeparatorInComments.txt | 26 +++ .../lineSeparatorInStringLiterals.kt | 20 ++ .../lineSeparatorInStringLiterals.txt | 93 ++++++++ .../whitespaceCharacters/nextLine/nextLine.kt | 4 + .../nextLine/nextLine.txt | 17 ++ .../nextLine/nextLineInComments.kt | 12 + .../nextLine/nextLineInComments.txt | 19 ++ .../nextLine/nextLineInStringLiterals.kt | 20 ++ .../nextLine/nextLineInStringLiterals.txt | 93 ++++++++ .../pageBreak/pageBreak.kt | 2 + .../pageBreak/pageBreak.txt | 15 ++ .../pageBreak/pageBreakInComments.kt | 12 + .../pageBreak/pageBreakInComments.txt | 19 ++ .../pageBreak/pageBreakInStringLiterals.kt | 20 ++ .../pageBreak/pageBreakInStringLiterals.txt | 93 ++++++++ .../paragraphSeparator/paragraphSeparator.kt | 3 + .../paragraphSeparator/paragraphSeparator.txt | 17 ++ .../paragraphSeparatorInComments.kt | 12 + .../paragraphSeparatorInComments.txt | 26 +++ .../paragraphSeparatorInStringLiterals.kt | 20 ++ .../paragraphSeparatorInStringLiterals.txt | 93 ++++++++ .../verticalTab/verticalTab.kt | 2 + .../verticalTab/verticalTab.txt | 16 ++ .../verticalTab/verticalTabInComments.kt | 12 + .../verticalTab/verticalTabInComments.txt | 19 ++ .../verticalTabInStringLiterals.kt | 20 ++ .../verticalTabInStringLiterals.txt | 93 ++++++++ .../generators/tests/GenerateCompilerTests.kt | 9 +- .../kotlin/kdoc/AbstractKDocLexerTest.kt | 58 ----- .../kotlin/lexer/AbstractLexerTest.kt | 45 ++++ .../lexer/kdoc/AbstractKDocLexerTest.kt | 11 + .../kdoc/KDocLexerTestGenerated.java | 15 +- .../lexer/kotlin/AbstractKotlinLexerTest.kt | 12 + .../kotlin/KotlinLexerTestGenerated.java | 212 ++++++++++++++++++ 47 files changed, 1306 insertions(+), 65 deletions(-) rename compiler/testData/{kdoc/lexer => lexer/kdoc}/codeBlocks.kt (100%) rename compiler/testData/{kdoc/lexer => lexer/kdoc}/codeBlocks.txt (100%) rename compiler/testData/{kdoc/lexer => lexer/kdoc}/codeBlocksWithVerticalTabs.kt (100%) rename compiler/testData/{kdoc/lexer => lexer/kdoc}/codeBlocksWithVerticalTabs.txt (100%) create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturn.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturn.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInComments.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInComments.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInStringLiterals.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInStringLiterals.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparator.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparator.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInComments.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInComments.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInStringLiterals.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInStringLiterals.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLine.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLine.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInComments.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInComments.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInStringLiterals.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInStringLiterals.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreak.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreak.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInComments.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInComments.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInStringLiterals.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInStringLiterals.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparator.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparator.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInComments.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInComments.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInStringLiterals.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInStringLiterals.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTab.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTab.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInComments.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInComments.txt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInStringLiterals.kt create mode 100644 compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInStringLiterals.txt delete mode 100644 compiler/tests/org/jetbrains/kotlin/kdoc/AbstractKDocLexerTest.kt create mode 100644 compiler/tests/org/jetbrains/kotlin/lexer/AbstractLexerTest.kt create mode 100644 compiler/tests/org/jetbrains/kotlin/lexer/kdoc/AbstractKDocLexerTest.kt rename compiler/tests/org/jetbrains/kotlin/{ => lexer}/kdoc/KDocLexerTestGenerated.java (70%) create mode 100644 compiler/tests/org/jetbrains/kotlin/lexer/kotlin/AbstractKotlinLexerTest.kt create mode 100644 compiler/tests/org/jetbrains/kotlin/lexer/kotlin/KotlinLexerTestGenerated.java diff --git a/compiler/testData/kdoc/lexer/codeBlocks.kt b/compiler/testData/lexer/kdoc/codeBlocks.kt similarity index 100% rename from compiler/testData/kdoc/lexer/codeBlocks.kt rename to compiler/testData/lexer/kdoc/codeBlocks.kt diff --git a/compiler/testData/kdoc/lexer/codeBlocks.txt b/compiler/testData/lexer/kdoc/codeBlocks.txt similarity index 100% rename from compiler/testData/kdoc/lexer/codeBlocks.txt rename to compiler/testData/lexer/kdoc/codeBlocks.txt diff --git a/compiler/testData/kdoc/lexer/codeBlocksWithVerticalTabs.kt b/compiler/testData/lexer/kdoc/codeBlocksWithVerticalTabs.kt similarity index 100% rename from compiler/testData/kdoc/lexer/codeBlocksWithVerticalTabs.kt rename to compiler/testData/lexer/kdoc/codeBlocksWithVerticalTabs.kt diff --git a/compiler/testData/kdoc/lexer/codeBlocksWithVerticalTabs.txt b/compiler/testData/lexer/kdoc/codeBlocksWithVerticalTabs.txt similarity index 100% rename from compiler/testData/kdoc/lexer/codeBlocksWithVerticalTabs.txt rename to compiler/testData/lexer/kdoc/codeBlocksWithVerticalTabs.txt diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturn.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturn.kt new file mode 100644 index 00000000000..784fdf42f23 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturn.kt @@ -0,0 +1 @@ +val x = 1 val y = 2 \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturn.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturn.txt new file mode 100644 index 00000000000..6486aafbde9 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturn.txt @@ -0,0 +1,15 @@ +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +INTEGER_LITERAL ('1') +WHITE_SPACE ('\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('y') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +INTEGER_LITERAL ('2') \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInComments.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInComments.kt new file mode 100644 index 00000000000..0c5b69b07ca --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInComments.kt @@ -0,0 +1,12 @@ +// some comment +// some comment + +/* */ +/* some comment */ +/* some comment */ +/* some comment */ + +/** */ +/** some doc */ +/** some doc */ +/** some doc */ \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInComments.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInComments.txt new file mode 100644 index 00000000000..08f08c9e5b1 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInComments.txt @@ -0,0 +1,25 @@ +EOL_COMMENT ('// some') +WHITE_SPACE ('\n') +IDENTIFIER ('comment') +WHITE_SPACE ('\n') +EOL_COMMENT ('//') +WHITE_SPACE ('\n') +IDENTIFIER ('some') +WHITE_SPACE (' ') +IDENTIFIER ('comment') +WHITE_SPACE ('\n\n') +BLOCK_COMMENT ('/*\n*/') +WHITE_SPACE ('\n') +BLOCK_COMMENT ('/* some\ncomment */') +WHITE_SPACE ('\n') +BLOCK_COMMENT ('/*\nsome comment */') +WHITE_SPACE ('\n') +BLOCK_COMMENT ('/* some comment\n*/') +WHITE_SPACE ('\n\n') +KDoc ('/**\n*/') +WHITE_SPACE ('\n') +KDoc ('/** some\ndoc */') +WHITE_SPACE ('\n') +KDoc ('/**\nsome doc */') +WHITE_SPACE ('\n') +KDoc ('/** some doc\n*/') \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInStringLiterals.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInStringLiterals.kt new file mode 100644 index 00000000000..191b30330f2 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInStringLiterals.kt @@ -0,0 +1,17 @@ +val x1 = ". ." + +val x2 = ". . " + +val x3 = " . ." + +val x4 = ' ' + +val x5 = """. .""" + +val x6 = """. . """ + +val x7 = """ . .""" + +val x8 = """. .""" + +val x9 = """. .""" \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInStringLiterals.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInStringLiterals.txt new file mode 100644 index 00000000000..4fc2762f38b --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInStringLiterals.txt @@ -0,0 +1,109 @@ +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x1') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART ('. ') +DANGLING_NEWLINE ('') +WHITE_SPACE ('\n ') +DOT ('.') +OPEN_QUOTE ('"') +DANGLING_NEWLINE ('') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x2') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART ('. .') +DANGLING_NEWLINE ('') +WHITE_SPACE ('\n') +OPEN_QUOTE ('"') +DANGLING_NEWLINE ('') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x3') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +DANGLING_NEWLINE ('') +WHITE_SPACE ('\n') +DOT ('.') +WHITE_SPACE (' ') +DOT ('.') +OPEN_QUOTE ('"') +DANGLING_NEWLINE ('') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x4') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +CHARACTER_LITERAL (''') +WHITE_SPACE ('\n') +CHARACTER_LITERAL (''') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x5') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('. ') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART (' .') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x6') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('. .') +REGULAR_STRING_PART ('\n') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x7') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART ('. .') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x8') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('.') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART ('.') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x9') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('.') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART ('.') +CLOSING_QUOTE ('"""') \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparator.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparator.kt new file mode 100644 index 00000000000..eed08820c89 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparator.kt @@ -0,0 +1,3 @@ +val x = 1 +
 +val y = 2 \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparator.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparator.txt new file mode 100644 index 00000000000..8116ef40447 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparator.txt @@ -0,0 +1,17 @@ +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +INTEGER_LITERAL ('1') +WHITE_SPACE ('\n') +BAD_CHARACTER ('
') +WHITE_SPACE ('\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('y') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +INTEGER_LITERAL ('2') \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInComments.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInComments.kt new file mode 100644 index 00000000000..87d0bcd55e0 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInComments.kt @@ -0,0 +1,12 @@ +// some
omment +//
some comment + +/*
*/ +/* some 
comment */ +/
some comment */ +/* some comment
*/ + +/** */ +/** some
doc */ +/**
some doc */ +/** some doc
*/ \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInComments.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInComments.txt new file mode 100644 index 00000000000..abfbe0ed0f7 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInComments.txt @@ -0,0 +1,26 @@ +EOL_COMMENT ('// some
omment') +WHITE_SPACE ('\n') +EOL_COMMENT ('//
some comment') +WHITE_SPACE ('\n\n') +BLOCK_COMMENT ('/*
*/') +WHITE_SPACE ('\n') +BLOCK_COMMENT ('/* some 
comment */') +WHITE_SPACE ('\n') +DIV ('/') +BAD_CHARACTER ('
') +IDENTIFIER ('some') +WHITE_SPACE (' ') +IDENTIFIER ('comment') +WHITE_SPACE (' ') +MUL ('*') +DIV ('/') +WHITE_SPACE ('\n') +BLOCK_COMMENT ('/* some comment
*/') +WHITE_SPACE ('\n\n') +KDoc ('/** */') +WHITE_SPACE ('\n') +KDoc ('/** some
doc */') +WHITE_SPACE ('\n') +KDoc ('/**
some doc */') +WHITE_SPACE ('\n') +KDoc ('/** some doc
*/') \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInStringLiterals.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInStringLiterals.kt new file mode 100644 index 00000000000..ada98c37bde --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInStringLiterals.kt @@ -0,0 +1,20 @@ +val x1 = ". 
 ." + +val x2 = ". .
" + +val x3 = "
. ." + +val x4 = '
' + +val x5 = """. 
 .""" + +val x6 = """. .
""" + +val x7 = """
. .""" + +val x8 = """. +
.""" + +val x9 = """. +
 +.""" \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInStringLiterals.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInStringLiterals.txt new file mode 100644 index 00000000000..e4d60717338 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInStringLiterals.txt @@ -0,0 +1,93 @@ +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x1') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART ('. 
 .') +CLOSING_QUOTE ('"') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x2') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART ('. .
') +CLOSING_QUOTE ('"') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x3') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART ('
. .') +CLOSING_QUOTE ('"') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x4') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +CHARACTER_LITERAL (''
'') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x5') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('. 
 .') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x6') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('. .
') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x7') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('
. .') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x8') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('.') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART ('
.') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x9') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('.') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART ('
') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART ('.') +CLOSING_QUOTE ('"""') \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLine.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLine.kt new file mode 100644 index 00000000000..46597fc2015 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLine.kt @@ -0,0 +1,4 @@ +val x = 1 +… + +val y = 2 \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLine.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLine.txt new file mode 100644 index 00000000000..4f07eecf06e --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLine.txt @@ -0,0 +1,17 @@ +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +INTEGER_LITERAL ('1') +WHITE_SPACE ('\n') +BAD_CHARACTER ('…') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('y') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +INTEGER_LITERAL ('2') \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInComments.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInComments.kt new file mode 100644 index 00000000000..f6fc148f51f --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInComments.kt @@ -0,0 +1,12 @@ +// some…comment +//…some comment + +/*…*/ +/* some…comment */ +/*…some comment */ +/* some comment…*/ + +/** */ +/** some…doc */ +/**…some doc */ +/** some doc…*/ \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInComments.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInComments.txt new file mode 100644 index 00000000000..f855a868d34 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInComments.txt @@ -0,0 +1,19 @@ +EOL_COMMENT ('// some…comment') +WHITE_SPACE ('\n') +EOL_COMMENT ('//…some comment') +WHITE_SPACE ('\n\n') +BLOCK_COMMENT ('/*…*/') +WHITE_SPACE ('\n') +BLOCK_COMMENT ('/* some…comment */') +WHITE_SPACE ('\n') +BLOCK_COMMENT ('/*…some comment */') +WHITE_SPACE ('\n') +BLOCK_COMMENT ('/* some comment…*/') +WHITE_SPACE ('\n\n') +KDoc ('/** */') +WHITE_SPACE ('\n') +KDoc ('/** some…doc */') +WHITE_SPACE ('\n') +KDoc ('/**…some doc */') +WHITE_SPACE ('\n') +KDoc ('/** some doc…*/') \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInStringLiterals.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInStringLiterals.kt new file mode 100644 index 00000000000..6e72421fa58 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInStringLiterals.kt @@ -0,0 +1,20 @@ +val x1 = ". … ." + +val x2 = ". .…" + +val x3 = "…. ." + +val x4 = '…' + +val x5 = """. … .""" + +val x6 = """. .…""" + +val x7 = """…. .""" + +val x8 = """. +….""" + +val x9 = """. +… +.""" \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInStringLiterals.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInStringLiterals.txt new file mode 100644 index 00000000000..bfd46e5ff15 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInStringLiterals.txt @@ -0,0 +1,93 @@ +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x1') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART ('. … .') +CLOSING_QUOTE ('"') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x2') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART ('. .…') +CLOSING_QUOTE ('"') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x3') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART ('…. .') +CLOSING_QUOTE ('"') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x4') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +CHARACTER_LITERAL (''…'') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x5') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('. … .') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x6') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('. .…') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x7') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('…. .') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x8') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('.') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART ('….') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x9') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('.') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART ('…') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART ('.') +CLOSING_QUOTE ('"""') \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreak.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreak.kt new file mode 100644 index 00000000000..ac6d8f8ad2d --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreak.kt @@ -0,0 +1,2 @@ +val x = 1 + val y = 2 \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreak.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreak.txt new file mode 100644 index 00000000000..e3d62d2118c --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreak.txt @@ -0,0 +1,15 @@ +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +INTEGER_LITERAL ('1') +WHITE_SPACE ('\n ') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('y') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +INTEGER_LITERAL ('2') \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInComments.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInComments.kt new file mode 100644 index 00000000000..1a3a4d9e5bb --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInComments.kt @@ -0,0 +1,12 @@ +// some comment +// some comment + +/* */ +/* some comment */ +/* some comment */ +/* some comment */ + +/** */ +/** some doc */ +/** some doc */ +/** some doc */ \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInComments.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInComments.txt new file mode 100644 index 00000000000..e99f11896cf --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInComments.txt @@ -0,0 +1,19 @@ +EOL_COMMENT ('// some comment') +WHITE_SPACE ('\n') +EOL_COMMENT ('// some comment') +WHITE_SPACE ('\n\n') +BLOCK_COMMENT ('/* */') +WHITE_SPACE ('\n') +BLOCK_COMMENT ('/* some comment */') +WHITE_SPACE ('\n') +BLOCK_COMMENT ('/* some comment */') +WHITE_SPACE ('\n') +BLOCK_COMMENT ('/* some comment */') +WHITE_SPACE ('\n\n') +KDoc ('/** */') +WHITE_SPACE ('\n') +KDoc ('/** some doc */') +WHITE_SPACE ('\n') +KDoc ('/** some doc */') +WHITE_SPACE ('\n') +KDoc ('/** some doc */') \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInStringLiterals.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInStringLiterals.kt new file mode 100644 index 00000000000..dbf21b38771 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInStringLiterals.kt @@ -0,0 +1,20 @@ +val x1 = ". ." + +val x2 = ". . " + +val x3 = " . ." + +val x4 = ' ' + +val x5 = """. .""" + +val x6 = """. . """ + +val x7 = """ . .""" + +val x8 = """. + .""" + +val x9 = """. + +.""" \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInStringLiterals.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInStringLiterals.txt new file mode 100644 index 00000000000..48dd33f150c --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInStringLiterals.txt @@ -0,0 +1,93 @@ +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x1') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART ('. .') +CLOSING_QUOTE ('"') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x2') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART ('. . ') +CLOSING_QUOTE ('"') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x3') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART (' . .') +CLOSING_QUOTE ('"') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x4') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +CHARACTER_LITERAL ('' '') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x5') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('. .') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x6') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('. . ') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x7') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART (' . .') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x8') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('.') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART (' .') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x9') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('.') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART (' ') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART ('.') +CLOSING_QUOTE ('"""') \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparator.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparator.kt new file mode 100644 index 00000000000..b6f256e9e13 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparator.kt @@ -0,0 +1,3 @@ +val x = 1 +
 +val y = 2 \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparator.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparator.txt new file mode 100644 index 00000000000..37b7d91af0e --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparator.txt @@ -0,0 +1,17 @@ +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +INTEGER_LITERAL ('1') +WHITE_SPACE ('\n') +BAD_CHARACTER ('
') +WHITE_SPACE ('\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('y') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +INTEGER_LITERAL ('2') \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInComments.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInComments.kt new file mode 100644 index 00000000000..9727079e749 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInComments.kt @@ -0,0 +1,12 @@ +// some
omment +//
some comment + +/*
*/ +/* some 
comment */ +/
some comment */ +/* some comment
*/ + +/** */ +/** some
doc */ +/**
some doc */ +/** some doc
*/ \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInComments.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInComments.txt new file mode 100644 index 00000000000..87ea850ac40 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInComments.txt @@ -0,0 +1,26 @@ +EOL_COMMENT ('// some
omment') +WHITE_SPACE ('\n') +EOL_COMMENT ('//
some comment') +WHITE_SPACE ('\n\n') +BLOCK_COMMENT ('/*
*/') +WHITE_SPACE ('\n') +BLOCK_COMMENT ('/* some 
comment */') +WHITE_SPACE ('\n') +DIV ('/') +BAD_CHARACTER ('
') +IDENTIFIER ('some') +WHITE_SPACE (' ') +IDENTIFIER ('comment') +WHITE_SPACE (' ') +MUL ('*') +DIV ('/') +WHITE_SPACE ('\n') +BLOCK_COMMENT ('/* some comment
*/') +WHITE_SPACE ('\n\n') +KDoc ('/** */') +WHITE_SPACE ('\n') +KDoc ('/** some
doc */') +WHITE_SPACE ('\n') +KDoc ('/**
some doc */') +WHITE_SPACE ('\n') +KDoc ('/** some doc
*/') \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInStringLiterals.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInStringLiterals.kt new file mode 100644 index 00000000000..10dcde76b24 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInStringLiterals.kt @@ -0,0 +1,20 @@ +val x1 = ". 
 ." + +val x2 = ". .
" + +val x3 = "
. ." + +val x4 = '
' + +val x5 = """. 
 .""" + +val x6 = """. .
""" + +val x7 = """
. .""" + +val x8 = """. +
.""" + +val x9 = """. +
 +.""" \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInStringLiterals.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInStringLiterals.txt new file mode 100644 index 00000000000..6632cc72266 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInStringLiterals.txt @@ -0,0 +1,93 @@ +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x1') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART ('. 
 .') +CLOSING_QUOTE ('"') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x2') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART ('. .
') +CLOSING_QUOTE ('"') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x3') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART ('
. .') +CLOSING_QUOTE ('"') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x4') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +CHARACTER_LITERAL (''
'') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x5') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('. 
 .') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x6') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('. .
') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x7') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('
. .') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x8') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('.') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART ('
.') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x9') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('.') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART ('
') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART ('.') +CLOSING_QUOTE ('"""') \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTab.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTab.kt new file mode 100644 index 00000000000..3b869d72f16 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTab.kt @@ -0,0 +1,2 @@ +val x = 1 + val y = 2 \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTab.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTab.txt new file mode 100644 index 00000000000..e43358f9abb --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTab.txt @@ -0,0 +1,16 @@ +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +INTEGER_LITERAL ('1') +WHITE_SPACE ('\n') +BAD_CHARACTER (' ') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('y') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +INTEGER_LITERAL ('2') \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInComments.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInComments.kt new file mode 100644 index 00000000000..08128e6f18b --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInComments.kt @@ -0,0 +1,12 @@ +// some comment +// some comment + +/* */ +/* some comment */ +/* some comment */ +/* some comment */ + +/** */ +/** some doc */ +/** some doc */ +/** some doc */ \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInComments.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInComments.txt new file mode 100644 index 00000000000..55833c6ab2c --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInComments.txt @@ -0,0 +1,19 @@ +EOL_COMMENT ('// some comment') +WHITE_SPACE ('\n') +EOL_COMMENT ('// some comment') +WHITE_SPACE ('\n\n') +BLOCK_COMMENT ('/* */') +WHITE_SPACE ('\n') +BLOCK_COMMENT ('/* some comment */') +WHITE_SPACE ('\n') +BLOCK_COMMENT ('/* some comment */') +WHITE_SPACE ('\n') +BLOCK_COMMENT ('/* some comment */') +WHITE_SPACE ('\n\n') +KDoc ('/** */') +WHITE_SPACE ('\n') +KDoc ('/** some doc */') +WHITE_SPACE ('\n') +KDoc ('/** some doc */') +WHITE_SPACE ('\n') +KDoc ('/** some doc */') diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInStringLiterals.kt b/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInStringLiterals.kt new file mode 100644 index 00000000000..4102ab5c810 --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInStringLiterals.kt @@ -0,0 +1,20 @@ +val x1 = ". ." + +val x2 = ". . " + +val x3 = " . ." + +val x4 = ' ' + +val x5 = """. .""" + +val x6 = """. . """ + +val x7 = """ . .""" + +val x8 = """. + .""" + +val x9 = """. + +.""" \ No newline at end of file diff --git a/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInStringLiterals.txt b/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInStringLiterals.txt new file mode 100644 index 00000000000..0a17345b37a --- /dev/null +++ b/compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInStringLiterals.txt @@ -0,0 +1,93 @@ +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x1') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART ('. .') +CLOSING_QUOTE ('"') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x2') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART ('. . ') +CLOSING_QUOTE ('"') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x3') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"') +REGULAR_STRING_PART (' . .') +CLOSING_QUOTE ('"') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x4') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +CHARACTER_LITERAL ('' '') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x5') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('. .') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x6') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('. . ') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x7') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART (' . .') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x8') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('.') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART (' .') +CLOSING_QUOTE ('"""') +WHITE_SPACE ('\n\n') +val ('val') +WHITE_SPACE (' ') +IDENTIFIER ('x9') +WHITE_SPACE (' ') +EQ ('=') +WHITE_SPACE (' ') +OPEN_QUOTE ('"""') +REGULAR_STRING_PART ('.') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART (' ') +REGULAR_STRING_PART ('\n') +REGULAR_STRING_PART ('.') +CLOSING_QUOTE ('"""') \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt index f0b66b38fb2..d9e2ffb7f86 100644 --- a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt +++ b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt @@ -29,7 +29,8 @@ import org.jetbrains.kotlin.ir.AbstractIrSourceRangesTestCase import org.jetbrains.kotlin.ir.AbstractIrTextTestCase import org.jetbrains.kotlin.jvm.compiler.* import org.jetbrains.kotlin.jvm.compiler.javac.AbstractLoadJavaUsingJavacTest -import org.jetbrains.kotlin.kdoc.AbstractKDocLexerTest +import org.jetbrains.kotlin.lexer.kdoc.AbstractKDocLexerTest +import org.jetbrains.kotlin.lexer.kotlin.AbstractKotlinLexerTest import org.jetbrains.kotlin.modules.xml.AbstractModuleXmlParserTest import org.jetbrains.kotlin.multiplatform.AbstractMultiPlatformIntegrationTest import org.jetbrains.kotlin.parsing.AbstractParsingTest @@ -350,7 +351,11 @@ fun main(args: Array) { } testClass { - model("kdoc/lexer") + model("lexer/kdoc") + } + + testClass { + model("lexer/kotlin") } testClass { diff --git a/compiler/tests/org/jetbrains/kotlin/kdoc/AbstractKDocLexerTest.kt b/compiler/tests/org/jetbrains/kotlin/kdoc/AbstractKDocLexerTest.kt deleted file mode 100644 index 4f63a6b291a..00000000000 --- a/compiler/tests/org/jetbrains/kotlin/kdoc/AbstractKDocLexerTest.kt +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.kdoc - -import com.intellij.lang.TokenWrapper -import com.intellij.lexer.Lexer -import com.intellij.openapi.util.text.StringUtil -import junit.framework.TestCase -import org.jetbrains.kotlin.kdoc.lexer.KDocLexer -import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase -import java.io.File - -abstract class AbstractKDocLexerTest : TestCase() { - protected fun doTest(fileName: String) { - val text = File(fileName).readText() - val lexerResult = printTokens(StringUtil.convertLineSeparators(text), 0, KDocLexer()) - KtUsefulTestCase.assertSameLinesWithFile(fileName.replaceAfterLast(".", "txt"), lexerResult) - } - - fun printTokens(text: CharSequence, start: Int, lexer: Lexer): String { - lexer.start(text, start, text.length) - var result = "" - while (true) { - val tokenType = lexer.tokenType ?: break - val tokenText = getTokenText(lexer) - val tokenTypeName = tokenType.toString() - val line = "$tokenTypeName ('$tokenText')\n" - result += line - lexer.advance() - } - return result - } - - private fun getTokenText(lexer: Lexer): String { - val tokenType = lexer.tokenType - if (tokenType is TokenWrapper) { - return tokenType.value - } - - var text = lexer.bufferSequence.subSequence(lexer.tokenStart, lexer.tokenEnd).toString() - text = StringUtil.replace(text, "\n", "\\n") - return text - } -} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/lexer/AbstractLexerTest.kt b/compiler/tests/org/jetbrains/kotlin/lexer/AbstractLexerTest.kt new file mode 100644 index 00000000000..c7b6f428869 --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/lexer/AbstractLexerTest.kt @@ -0,0 +1,45 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.lexer + +import com.intellij.lang.TokenWrapper +import com.intellij.lexer.Lexer +import com.intellij.openapi.util.text.StringUtil +import junit.framework.TestCase +import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase +import java.io.File + +abstract class AbstractLexerTest(private val lexer: Lexer) : TestCase() { + protected fun doTest(fileName: String) { + val text = File(fileName).readText() + val lexerResult = printTokens(StringUtil.convertLineSeparators(text), 0, lexer) + + KtUsefulTestCase.assertSameLinesWithFile(fileName.replaceAfterLast(".", "txt"), lexerResult) + } + + private fun printTokens(text: CharSequence, start: Int, lexer: Lexer): String { + lexer.start(text, start, text.length) + + return buildString { + while (true) { + val tokenType = lexer.tokenType ?: break + append("$tokenType ('${getTokenText(lexer)}')\n") + lexer.advance() + } + } + } + + private fun getTokenText(lexer: Lexer): String { + val tokenType = lexer.tokenType + + if (tokenType is TokenWrapper) + return tokenType.value + + val result = lexer.bufferSequence.subSequence(lexer.tokenStart, lexer.tokenEnd).toString() + + return StringUtil.replace(result, "\n", "\\n") + } +} diff --git a/compiler/tests/org/jetbrains/kotlin/lexer/kdoc/AbstractKDocLexerTest.kt b/compiler/tests/org/jetbrains/kotlin/lexer/kdoc/AbstractKDocLexerTest.kt new file mode 100644 index 00000000000..888c71d6f62 --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/lexer/kdoc/AbstractKDocLexerTest.kt @@ -0,0 +1,11 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.lexer.kdoc + +import org.jetbrains.kotlin.kdoc.lexer.KDocLexer +import org.jetbrains.kotlin.lexer.AbstractLexerTest + +abstract class AbstractKDocLexerTest : AbstractLexerTest(KDocLexer()) diff --git a/compiler/tests/org/jetbrains/kotlin/kdoc/KDocLexerTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/lexer/kdoc/KDocLexerTestGenerated.java similarity index 70% rename from compiler/tests/org/jetbrains/kotlin/kdoc/KDocLexerTestGenerated.java rename to compiler/tests/org/jetbrains/kotlin/lexer/kdoc/KDocLexerTestGenerated.java index 8602ebc48ab..51de7c3c8a3 100644 --- a/compiler/tests/org/jetbrains/kotlin/kdoc/KDocLexerTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/lexer/kdoc/KDocLexerTestGenerated.java @@ -3,7 +3,7 @@ * that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.kdoc; +package org.jetbrains.kotlin.lexer.kdoc; import com.intellij.testFramework.TestDataPath; import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; @@ -17,7 +17,7 @@ import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@TestMetadata("compiler/testData/kdoc/lexer") +@TestMetadata("compiler/testData/lexer/kdoc") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public class KDocLexerTestGenerated extends AbstractKDocLexerTest { @@ -25,12 +25,17 @@ public class KDocLexerTestGenerated extends AbstractKDocLexerTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } - public void testAllFilesPresentInLexer() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/kdoc/lexer"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + public void testAllFilesPresentInKdoc() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/lexer/kdoc"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("codeBlocks.kt") public void testCodeBlocks() throws Exception { - runTest("compiler/testData/kdoc/lexer/codeBlocks.kt"); + runTest("compiler/testData/lexer/kdoc/codeBlocks.kt"); + } + + @TestMetadata("codeBlocksWithVerticalTabs.kt") + public void testCodeBlocksWithVerticalTabs() throws Exception { + runTest("compiler/testData/lexer/kdoc/codeBlocksWithVerticalTabs.kt"); } } diff --git a/compiler/tests/org/jetbrains/kotlin/lexer/kotlin/AbstractKotlinLexerTest.kt b/compiler/tests/org/jetbrains/kotlin/lexer/kotlin/AbstractKotlinLexerTest.kt new file mode 100644 index 00000000000..91dfa21398b --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/lexer/kotlin/AbstractKotlinLexerTest.kt @@ -0,0 +1,12 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.lexer.kotlin + +import org.jetbrains.kotlin.lexer.AbstractLexerTest +import org.jetbrains.kotlin.lexer.KotlinLexer + + +abstract class AbstractKotlinLexerTest : AbstractLexerTest(KotlinLexer()) diff --git a/compiler/tests/org/jetbrains/kotlin/lexer/kotlin/KotlinLexerTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/lexer/kotlin/KotlinLexerTestGenerated.java new file mode 100644 index 00000000000..64ec7aa9ade --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/lexer/kotlin/KotlinLexerTestGenerated.java @@ -0,0 +1,212 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.lexer.kotlin; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.TargetBackend; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/lexer/kotlin") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class KotlinLexerTestGenerated extends AbstractKotlinLexerTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInKotlin() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/lexer/kotlin"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("compiler/testData/lexer/kotlin/whitespaceCharacters") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class WhitespaceCharacters extends AbstractKotlinLexerTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInWhitespaceCharacters() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/lexer/kotlin/whitespaceCharacters"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CarriageReturn extends AbstractKotlinLexerTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInCarriageReturn() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("carriageReturn.kt") + public void testCarriageReturn() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturn.kt"); + } + + @TestMetadata("carriageReturnInComments.kt") + public void testCarriageReturnInComments() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInComments.kt"); + } + + @TestMetadata("carriageReturnInStringLiterals.kt") + public void testCarriageReturnInStringLiterals() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/carriageReturn/carriageReturnInStringLiterals.kt"); + } + } + + @TestMetadata("compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class LineSeparator extends AbstractKotlinLexerTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInLineSeparator() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("lineSeparator.kt") + public void testLineSeparator() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparator.kt"); + } + + @TestMetadata("lineSeparatorInComments.kt") + public void testLineSeparatorInComments() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInComments.kt"); + } + + @TestMetadata("lineSeparatorInStringLiterals.kt") + public void testLineSeparatorInStringLiterals() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/lineSeparator/lineSeparatorInStringLiterals.kt"); + } + } + + @TestMetadata("compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NextLine extends AbstractKotlinLexerTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInNextLine() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("nextLine.kt") + public void testNextLine() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLine.kt"); + } + + @TestMetadata("nextLineInComments.kt") + public void testNextLineInComments() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInComments.kt"); + } + + @TestMetadata("nextLineInStringLiterals.kt") + public void testNextLineInStringLiterals() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/nextLine/nextLineInStringLiterals.kt"); + } + } + + @TestMetadata("compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class PageBreak extends AbstractKotlinLexerTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInPageBreak() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("pageBreak.kt") + public void testPageBreak() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreak.kt"); + } + + @TestMetadata("pageBreakInComments.kt") + public void testPageBreakInComments() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInComments.kt"); + } + + @TestMetadata("pageBreakInStringLiterals.kt") + public void testPageBreakInStringLiterals() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/pageBreak/pageBreakInStringLiterals.kt"); + } + } + + @TestMetadata("compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ParagraphSeparator extends AbstractKotlinLexerTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInParagraphSeparator() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("paragraphSeparator.kt") + public void testParagraphSeparator() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparator.kt"); + } + + @TestMetadata("paragraphSeparatorInComments.kt") + public void testParagraphSeparatorInComments() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInComments.kt"); + } + + @TestMetadata("paragraphSeparatorInStringLiterals.kt") + public void testParagraphSeparatorInStringLiterals() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/paragraphSeparator/paragraphSeparatorInStringLiterals.kt"); + } + } + + @TestMetadata("compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class VerticalTab extends AbstractKotlinLexerTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInVerticalTab() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("verticalTab.kt") + public void testVerticalTab() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTab.kt"); + } + + @TestMetadata("verticalTabInComments.kt") + public void testVerticalTabInComments() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInComments.kt"); + } + + @TestMetadata("verticalTabInStringLiterals.kt") + public void testVerticalTabInStringLiterals() throws Exception { + runTest("compiler/testData/lexer/kotlin/whitespaceCharacters/verticalTab/verticalTabInStringLiterals.kt"); + } + } + } +}