diff options
Diffstat (limited to 'testrelabelparser.lua')
-rw-r--r-- | testrelabelparser.lua | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/testrelabelparser.lua b/testrelabelparser.lua index 0399ff6..27c3e52 100644 --- a/testrelabelparser.lua +++ b/testrelabelparser.lua | |||
@@ -8,14 +8,14 @@ function testerror(repatt, msg) | |||
8 | -- expecting a syntax error | 8 | -- expecting a syntax error |
9 | err = err:match("^[^\n]*\n(.-)$") -- remove first line (filename) | 9 | err = err:match("^[^\n]*\n(.-)$") -- remove first line (filename) |
10 | err = err:gsub("[ \t]*\n", "\n") -- remove trailing spaces | 10 | err = err:gsub("[ \t]*\n", "\n") -- remove trailing spaces |
11 | -- if err ~= msg then | 11 | --if err ~= msg then |
12 | -- print(#err, #msg) | 12 | --print(#err, #msg) |
13 | -- print('--') | 13 | --print('--') |
14 | -- print(err) | 14 | --print(err) |
15 | -- print('--') | 15 | --print('--') |
16 | -- print(msg) | 16 | --print(msg) |
17 | -- print('--') | 17 | --print('--') |
18 | -- end | 18 | --end |
19 | assert(err == msg) | 19 | assert(err == msg) |
20 | else | 20 | else |
21 | -- expecting a non-syntax error | 21 | -- expecting a non-syntax error |
@@ -366,16 +366,14 @@ L1:C2: expected a name or label after '%' (no space) | |||
366 | ^ | 366 | ^ |
367 | ]]) | 367 | ]]) |
368 | 368 | ||
369 | -- testing ExpItem | 369 | -- testing empty char set (MisClose8, previously MisItem) |
370 | 370 | ||
371 | testerror([[ | 371 | testerror([[ |
372 | "p" [ | 372 | "p" [] "q" |
373 | abc | ||
374 | ] "q" | ||
375 | ]], [[ | 373 | ]], [[ |
376 | L1:C6: expected at least one item after '[' or '^' | 374 | L2:C1: missing closing ']' or empty char class |
377 | "p" [ | 375 | |
378 | ^ | 376 | ^ |
379 | ]]) | 377 | ]]) |
380 | 378 | ||
381 | -- testing MisClose1 | 379 | -- testing MisClose1 |
@@ -451,31 +449,31 @@ L1:C9: missing closing '}' | |||
451 | -- testing MisClose8 | 449 | -- testing MisClose8 |
452 | 450 | ||
453 | testerror([[[]], [[ | 451 | testerror([[[]], [[ |
454 | L1:C2: missing closing ']' | 452 | L1:C2: missing closing ']' or empty char class |
455 | [ | 453 | [ |
456 | ^ | 454 | ^ |
457 | ]]) | 455 | ]]) |
458 | 456 | ||
459 | testerror([[[^]], [[ | 457 | testerror([[[^]], [[ |
460 | L1:C3: missing closing ']' | 458 | L1:C3: missing closing ']' or empty char class |
461 | [^ | 459 | [^ |
462 | ^ | 460 | ^ |
463 | ]]) | 461 | ]]) |
464 | 462 | ||
465 | testerror([[[] ]], [[ | 463 | testerror([[[] ]], [[ |
466 | L1:C4: missing closing ']' | 464 | L1:C4: missing closing ']' or empty char class |
467 | [] | 465 | [] |
468 | ^ | 466 | ^ |
469 | ]]) | 467 | ]]) |
470 | 468 | ||
471 | testerror([[[^] ]], [[ | 469 | testerror([[[^] ]], [[ |
472 | L1:C6: missing closing ']' | 470 | L1:C6: missing closing ']' or empty char class |
473 | [^] | 471 | [^] |
474 | ^ | 472 | ^ |
475 | ]]) | 473 | ]]) |
476 | 474 | ||
477 | testerror([[[_-___-_|]], [[ | 475 | testerror([[[_-___-_|]], [[ |
478 | L1:C10: missing closing ']' | 476 | L1:C10: missing closing ']' or empty char class |
479 | [_-___-_| | 477 | [_-___-_| |
480 | ^ | 478 | ^ |
481 | ]]) | 479 | ]]) |