Skip to content

Commit ce76257

Browse files
committed
lexer.Consume(): Add test for insignificant comma
1 parent 2589e2f commit ce76257

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

internal/common/lexer_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ var consumeTests = []consumeTestCase{{
1818
1919
# Comment line 1
2020
# Comment line 2
21+
,,,,,, # Commas are insignificant
2122
type Hello {
22-
world: String!
23+
world: String!
2324
}`,
24-
expected: "Comment line 1\nComment line 2",
25+
expected: "Comment line 1\nComment line 2\nCommas are insignificant",
2526
}}
2627

2728
func TestConsume(t *testing.T) {
@@ -35,7 +36,7 @@ func TestConsume(t *testing.T) {
3536
}
3637

3738
if test.expected != lex.DescComment() {
38-
t.Errorf("wanted: %q\ngot: %q", test.expected, lex.DescComment())
39+
t.Errorf("wrong description value:\nwant: %q\ngot : %q", test.expected, lex.DescComment())
3940
}
4041
})
4142
}

0 commit comments

Comments
 (0)