@@ -303,21 +303,27 @@ describe "Python grammar", ->
303
303
" string.quoted.double.block.sql.python" : ' """'
304
304
" string.quoted.single.block.sql.python" : " '''"
305
305
306
- for scope, delim in delimsByScope
307
- tokens = grammar .tokenizeLines (
308
- delim +
309
- ' WITH example_cte AS (
310
- SELECT bar
311
- FROM foo
312
- GROUP BY bar
306
+ for scope, delim of delimsByScope
307
+ tokens = grammar .tokenizeLines ("""
308
+ #{ delim}
309
+ WITH example_cte AS (
310
+ SELECT bar
311
+ FROM foo
312
+ GROUP BY bar
313
313
)
314
314
315
- SELECT COUNT(*)
316
- FROM example_cte'
317
- + delim
318
- )
315
+ SELECT COUNT(*)
316
+ FROM example_cte
317
+ #{ delim}
318
+ """ )
319
319
320
320
expect (tokens[0 ][0 ]).toEqual value : delim, scopes : [' source.python' , scope, ' punctuation.definition.string.begin.python' ]
321
- expect (tokens[1 ][0 ]).toEqual value : ' SELECT bar' , scopes : [' source.python' , scope]
322
- expect (tokens[2 ][0 ]).toEqual value : ' FROM foo' , scopes : [' source.python' , scope]
323
- expect (tokens[3 ][0 ]).toEqual value : delim, scopes : [' source.python' , scope, ' punctuation.definition.string.end.python' ]
321
+ expect (tokens[1 ][0 ]).toEqual value : ' WITH example_cte AS (' , scopes : [' source.python' , scope]
322
+ expect (tokens[2 ][0 ]).toEqual value : ' SELECT bar' , scopes : [' source.python' , scope]
323
+ expect (tokens[3 ][0 ]).toEqual value : ' FROM foo' , scopes : [' source.python' , scope]
324
+ expect (tokens[4 ][0 ]).toEqual value : ' GROUP BY bar' , scopes : [' source.python' , scope]
325
+ expect (tokens[5 ][0 ]).toEqual value : ' )' , scopes : [' source.python' , scope]
326
+ expect (tokens[6 ][0 ]).toEqual value : ' ' , scopes : [' source.python' , scope]
327
+ expect (tokens[7 ][0 ]).toEqual value : ' SELECT COUNT(*)' , scopes : [' source.python' , scope]
328
+ expect (tokens[8 ][0 ]).toEqual value : ' FROM example_cte' , scopes : [' source.python' , scope]
329
+ expect (tokens[9 ][0 ]).toEqual value : delim, scopes : [' source.python' , scope, ' punctuation.definition.string.end.python' ]
0 commit comments