diff options
Diffstat (limited to 'spec/lexer_test.go')
-rw-r--r-- | spec/lexer_test.go | 15 |
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, |