From 0f6008f46e837262156073d45c5a0f9a3c5afcc6 Mon Sep 17 00:00:00 2001 From: Thomas Pelletier Date: Mon, 9 Dec 2013 19:05:18 +0100 Subject: [PATCH] Add some tests for the lexer --- lexer_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lexer_test.go b/lexer_test.go index 9a98689..e5846bd 100644 --- a/lexer_test.go +++ b/lexer_test.go @@ -207,6 +207,22 @@ func TestArrayInts(t *testing.T) { }) } +func TestMultilineArrayComments(t *testing.T) { + testFlow(t, "a = [1, # wow\n2, # such items\n3, # so array\n]", []token{ + token{tokenKey, "a"}, + token{tokenEqual, "="}, + token{tokenLeftBracket, "["}, + token{tokenInteger, "1"}, + token{tokenComma, ","}, + token{tokenInteger, "2"}, + token{tokenComma, ","}, + token{tokenInteger, "3"}, + token{tokenComma, ","}, + token{tokenRightBracket, "]"}, + token{tokenEOF, ""}, + }) +} + func TestKeyEqualArrayBools(t *testing.T) { testFlow(t, "foo = [true, false, true]", []token{ token{tokenKey, "foo"},