-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore
\n
for all input in runtime tests, add extra LexerExec test…
…s (LineSeparatorLf, LineSeparatorCrLf)
- Loading branch information
Showing
5 changed files
with
52 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
# This rule applies to all files which don't match another line below | ||
* text=auto | ||
LineSeparator_LF.txt eol=lf | ||
LineSeparator_CRLF.txt eol=crlf | ||
* text=auto |
20 changes: 0 additions & 20 deletions
20
...estsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/LineSeparator_CRLF.txt
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
...-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/LineSeparator_LF.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
runtime-testsuite/test/org/antlr/v4/test/runtime/ExtraTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package org.antlr.v4.test.runtime; | ||
|
||
public class ExtraTests { | ||
static RuntimeTestDescriptor getLineSeparatorLfTest(String targetName) { | ||
UniversalRuntimeTestDescriptor result = new UniversalRuntimeTestDescriptor(); | ||
result.name = "LineSeparatorLf"; | ||
result.targetName = targetName; | ||
result.testType = "Lexer"; | ||
result.grammar = "lexer grammar L;\n" + | ||
"T: ~'\\n'+;\n" + | ||
"SEPARATOR: '\\n';"; | ||
result.grammarName = "L"; | ||
result.input = "1\n2\n3"; | ||
result.output = "[@0,0:0='1',<1>,1:0]\n" + | ||
"[@1,1:1='\\n',<2>,1:1]\n" + | ||
"[@2,2:2='2',<1>,2:0]\n" + | ||
"[@3,3:3='\\n',<2>,2:1]\n" + | ||
"[@4,4:4='3',<1>,3:0]\n" + | ||
"[@5,5:4='<EOF>',<-1>,3:1]\n"; | ||
return result; | ||
} | ||
|
||
static RuntimeTestDescriptor getLineSeparatorCrLfTest(String targetName) { | ||
UniversalRuntimeTestDescriptor result = new UniversalRuntimeTestDescriptor(); | ||
result.name = "LineSeparatorCrLf"; | ||
result.targetName = targetName; | ||
result.testType = "Lexer"; | ||
result.grammar = "lexer grammar L;\n" + | ||
"T: ~'\\r'+;\n" + | ||
"SEPARATOR: '\\r\\n';"; | ||
result.grammarName = "L"; | ||
result.input = "1\r\n2\r\n3"; | ||
result.output = "[@0,0:0='1',<1>,1:0]\n" + | ||
"[@1,1:2='\\r\\n',<2>,1:1]\n" + | ||
"[@2,3:3='2',<1>,2:0]\n" + | ||
"[@3,4:5='\\r\\n',<2>,2:1]\n" + | ||
"[@4,6:6='3',<1>,3:0]\n" + | ||
"[@5,7:6='<EOF>',<-1>,3:1]\n"; | ||
return result; | ||
} | ||
} |