|
266 | 266 | @test collect(Lexer("# comment\n # \n# more\n")) == |
267 | 267 | [Token(K"comment", 1, 20)] |
268 | 268 | end |
| 269 | + @testset "Fixed width" begin |
| 270 | + @test collect(Lexer(":")) == |
| 271 | + [Token(K"fixedwidth", 1, 1)] |
| 272 | + @test collect(Lexer(": fixed")) == |
| 273 | + [Token(K"fixedwidth", 1, 9)] |
| 274 | + @test collect(Lexer(": fixed\n: more")) == |
| 275 | + [Token(K"fixedwidth", 1, 14)] |
| 276 | + @test collect(Lexer(": fixed\n:\n: more")) == |
| 277 | + [Token(K"fixedwidth", 1, 16)] |
| 278 | + @test collect(Lexer(": fixed\n : \n: more\n")) == |
| 279 | + [Token(K"fixedwidth", 1, 28)] |
| 280 | + end |
269 | 281 | @testset "Type inference" begin |
270 | 282 | @testset "Utilities" begin |
271 | 283 | bytes, pos = codeunits("abc"), UInt32(1) |
|
302 | 314 | @inferred Tuple{Token, UInt32} Org.lex_diarysexp(lstate, bytes, pos) |
303 | 315 | @inferred Tuple{Token, UInt32} Org.lex_planning(lstate, bytes, pos) |
304 | 316 | @inferred Tuple{Token, UInt32} Org.lex_comment(lstate, bytes, pos) |
| 317 | + @inferred Tuple{Token, UInt32} Org.lex_fixedwidth(lstate, bytes, pos) |
305 | 318 | end |
306 | 319 | end |
307 | 320 | @testset "Unhandled errors" begin |
|
340 | 353 | @test_call Org.lex_diarysexp(lstate, bytes, pos) |
341 | 354 | @test_call Org.lex_planning(lstate, bytes, pos) |
342 | 355 | @test_call Org.lex_comment(lstate, bytes, pos) |
| 356 | + @test_call Org.lex_fixedwidth(lstate, bytes, pos) |
343 | 357 | end |
344 | 358 | @testset "Iteration" begin |
345 | 359 | @test_call iterate(Lexer("abc"), LexerState()) |
|
381 | 395 | @test_opt Org.lex_diarysexp(lstate, bytes, pos) |
382 | 396 | @test_opt Org.lex_planning(lstate, bytes, pos) |
383 | 397 | @test_opt Org.lex_comment(lstate, bytes, pos) |
| 398 | + @test_opt Org.lex_fixedwidth(lstate, bytes, pos) |
384 | 399 | end |
385 | 400 | @testset "Iteration" begin |
386 | 401 | @test_opt iterate(Lexer("abc"), LexerState()) |
|
0 commit comments