Skip to content

Commit e01d297

Browse files
committed
New test
1 parent 37d2fb4 commit e01d297

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/lexer.spec.coffee

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,23 @@ describe "SQL Lexer", ->
158158
[ 'RIGHT_PAREN', ')', 1 ]
159159
["EOF", "", 1]
160160
]
161+
162+
it "eats insert queries with multiple rows and column names", ->
163+
tokens = lexer.tokenize("insert into my_table (foo) values ('a'),('b')")
164+
tokens.should.eql [
165+
["INSERT", "insert", 1]
166+
["INTO", "into", 1]
167+
["LITERAL", "my_table", 1]
168+
[ 'LEFT_PAREN', '(', 1 ]
169+
[ 'LITERAL', 'foo', 1 ]
170+
[ 'RIGHT_PAREN', ')', 1 ]
171+
["VALUES", "values", 1]
172+
[ 'LEFT_PAREN', '(', 1 ]
173+
[ 'STRING', 'a', 1 ]
174+
[ 'RIGHT_PAREN', ')', 1 ]
175+
[ 'SEPARATOR', ',', 1 ]
176+
[ 'LEFT_PAREN', '(', 1 ]
177+
[ 'STRING', 'b', 1 ]
178+
[ 'RIGHT_PAREN', ')', 1 ]
179+
["EOF", "", 1]
180+
]

0 commit comments

Comments
 (0)