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.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lexer_test.go b/spec/lexer_test.go
index 1edf15c..484ad30 100644
--- a/spec/lexer_test.go
+++ b/spec/lexer_test.go
@@ -33,6 +33,21 @@ func TestLexer_Run(t *testing.T) {
},
},
{
+ caption: "the lexer ignores line comments",
+ src: `
+// This is the first comment.
+foo
+// This is the second comment.
+// This is the third comment.
+bar // This is the fourth comment.
+`,
+ tokens: []*token{
+ newIDToken("foo"),
+ newIDToken("bar"),
+ newEOFToken(),
+ },
+ },
+ {
caption: "an unclosed terminal is not a valid token",
src: `"abc`,
err: synErrUnclosedTerminal,