From 523f40968b9c1a23da1f4a1c2f125197d7611fef Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 20 May 2017 16:28:10 +0200 Subject: 04 --- lexer/lexer_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lexer/lexer_test.go') diff --git a/lexer/lexer_test.go b/lexer/lexer_test.go index 0a7f248..e4e64a4 100644 --- a/lexer/lexer_test.go +++ b/lexer/lexer_test.go @@ -26,6 +26,10 @@ if (5 < 10) { 10 == 10; 10 != 9; +"foobar" +"foo bar" +[1, 2]; +{"foo": "bar"} ` tests := []struct { @@ -105,6 +109,19 @@ if (5 < 10) { {token.NOT_EQ, "!="}, {token.INT, "9"}, {token.SEMICOLON, ";"}, + {token.STRING, "foobar"}, + {token.STRING, "foo bar"}, + {token.LBRACKET, "["}, + {token.INT, "1"}, + {token.COMMA, ","}, + {token.INT, "2"}, + {token.RBRACKET, "]"}, + {token.SEMICOLON, ";"}, + {token.LBRACE, "{"}, + {token.STRING, "foo"}, + {token.COLON, ":"}, + {token.STRING, "bar"}, + {token.RBRACE, "}"}, {token.EOF, ""}, } -- cgit v1.2.3