aboutsummaryrefslogtreecommitdiff
path: root/spec/lexer_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lexer_test.go')
-rw-r--r--spec/lexer_test.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/spec/lexer_test.go b/spec/lexer_test.go
index 5f555ec..d822de2 100644
--- a/spec/lexer_test.go
+++ b/spec/lexer_test.go
@@ -70,10 +70,10 @@ func TestLexer_Run(t *testing.T) {
},
},
{
- caption: "the lexer can recognize character sequences and escape sequences in a string literal",
- src: `'.*+?|()[\'\\'`,
+ caption: "backslashes are recognized as they are because escape sequences are not allowed in strings",
+ src: `'\\\'`,
tokens: []*token{
- strTok(`.*+?|()['\`),
+ strTok(`\\\`),
newEOFToken(),
},
},
@@ -160,7 +160,7 @@ bar // This is the fourth comment.
err: synErrUnclosedTerminal,
},
{
- caption: "an incompleted terminal in a pattern is not a valid token",
+ caption: "an incompleted escape sequence in a pattern is not a valid token",
src: `"\`,
err: synErrIncompletedEscSeq,
},
@@ -170,11 +170,6 @@ bar // This is the fourth comment.
err: synErrUnclosedString,
},
{
- caption: "an incompleted terminal in a string is not a valid token",
- src: `'\`,
- err: synErrIncompletedEscSeq,
- },
- {
caption: "the lexer can recognize valid tokens following an invalid token",
src: `abc!!!def`,
tokens: []*token{