diff options
author | Undecidable Robot <undecidabot@gmail.com> | 2016-05-30 23:02:11 +0800 |
---|---|---|
committer | Undecidable Robot <undecidabot@gmail.com> | 2016-05-30 23:02:11 +0800 |
commit | 2fa6d9b25eb2fec85f9c1e9f67189b9b85ffa76b (patch) | |
tree | 105200c83009d4f192c15abad85af5e4aa45fcff | |
parent | 986072fa5423fc8562caabf6b6afcf4172e45aa4 (diff) | |
download | lpeglabel-2fa6d9b25eb2fec85f9c1e9f67189b9b85ffa76b.tar.gz lpeglabel-2fa6d9b25eb2fec85f9c1e9f67189b9b85ffa76b.tar.bz2 lpeglabel-2fa6d9b25eb2fec85f9c1e9f67189b9b85ffa76b.zip |
Slightly adjusting tests
-rw-r--r-- | testerrors.lua | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/testerrors.lua b/testerrors.lua index 9c10aa6..010f111 100644 --- a/testerrors.lua +++ b/testerrors.lua | |||
@@ -17,7 +17,7 @@ function testerror(repatt, msg) | |||
17 | assert(err == msg) | 17 | assert(err == msg) |
18 | end | 18 | end |
19 | 19 | ||
20 | testerror([[~]],[[ | 20 | testerror([[~]], [[ |
21 | L1:C1: no pattern found | 21 | L1:C1: no pattern found |
22 | ~ | 22 | ~ |
23 | ^ | 23 | ^ |
@@ -468,7 +468,7 @@ testerror([[ | |||
468 | A <- 'a' (B 'b' | 468 | A <- 'a' (B 'b' |
469 | B <- 'x' / ! | 469 | B <- 'x' / ! |
470 | C <- 'c' | 470 | C <- 'c' |
471 | ]],[[ | 471 | ]], [[ |
472 | L1:C18: missing closing ')' | 472 | L1:C18: missing closing ')' |
473 | A <- 'a' (B 'b' | 473 | A <- 'a' (B 'b' |
474 | ^ | 474 | ^ |
@@ -481,7 +481,7 @@ testerror([[ | |||
481 | A <- %nosuch %def | 481 | A <- %nosuch %def |
482 | A <- 'A again' | 482 | A <- 'A again' |
483 | A <- 'and again' | 483 | A <- 'and again' |
484 | ]],[[ | 484 | ]], [[ |
485 | name 'nosuch' undefined | 485 | name 'nosuch' undefined |
486 | name 'def' undefined | 486 | name 'def' undefined |
487 | 'A' already defined as a rule | 487 | 'A' already defined as a rule |
@@ -499,7 +499,7 @@ testerror([[ | |||
499 | A <- %nosuch %def | 499 | A <- %nosuch %def |
500 | A <- 'A again' | 500 | A <- 'A again' |
501 | A <- 'and again' | 501 | A <- 'and again' |
502 | ]],[[ | 502 | ]], [[ |
503 | name 'nosuch' undefined | 503 | name 'nosuch' undefined |
504 | name 'def' undefined | 504 | name 'def' undefined |
505 | 'A' already defined as a rule | 505 | 'A' already defined as a rule |
@@ -543,7 +543,7 @@ L1:C5: expected a pattern after '/' or the label(s) | |||
543 | testerror([[ | 543 | testerror([[ |
544 | S <- 'forgot to close / T | 544 | S <- 'forgot to close / T |
545 | T <- 'T' & / 't' | 545 | T <- 'T' & / 't' |
546 | ]],[[ | 546 | ]], [[ |
547 | L1:C8: missing terminating single quote | 547 | L1:C8: missing terminating single quote |
548 | S <- 'forgot to close / T | 548 | S <- 'forgot to close / T |
549 | ^ | 549 | ^ |
@@ -555,7 +555,7 @@ L2:C13: expected a pattern after '&' | |||
555 | testerror([[ | 555 | testerror([[ |
556 | S <- [a-z / T | 556 | S <- [a-z / T |
557 | T <- 'x' / & / 'y' | 557 | T <- 'x' / & / 'y' |
558 | ]],[[ | 558 | ]], [[ |
559 | L1:C8: missing closing ']' | 559 | L1:C8: missing closing ']' |
560 | S <- [a-z / T | 560 | S <- [a-z / T |
561 | ^ | 561 | ^ |
@@ -566,7 +566,7 @@ L2:C15: expected a pattern after '&' | |||
566 | 566 | ||
567 | testerror([[ | 567 | testerror([[ |
568 | S <- ('p' -- comment | 568 | S <- ('p' -- comment |
569 | ]],[[ | 569 | ]], [[ |
570 | L1:C12: missing closing ')' | 570 | L1:C12: missing closing ')' |
571 | S <- ('p' -- comment | 571 | S <- ('p' -- comment |
572 | ^ | 572 | ^ |
@@ -578,7 +578,7 @@ testerror([[ | |||
578 | Q <- 'q' | 578 | Q <- 'q' |
579 | R <- 'r' | 579 | R <- 'r' |
580 | S <- 's' | 580 | S <- 's' |
581 | ]],[[ | 581 | ]], [[ |
582 | L1:C9: missing terminating single quote | 582 | L1:C9: missing terminating single quote |
583 | X <- ('p / Q (R | 583 | X <- ('p / Q (R |
584 | ^ | 584 | ^ |
@@ -593,7 +593,7 @@ testerror([[ | |||
593 | B <- %{1, 2 3} 'b' / '6' & / 'B' | 593 | B <- %{1, 2 3} 'b' / '6' & / 'B' |
594 | 594 | ||
595 | C <- A^B | 595 | C <- A^B |
596 | ]],[[ | 596 | ]], [[ |
597 | L1:C14: expected at least one label after '{' | 597 | L1:C14: expected at least one label after '{' |
598 | A <- 'A' /{'lab'} B / ! | 598 | A <- 'A' /{'lab'} B / ! |
599 | ^ | 599 | ^ |
@@ -611,5 +611,13 @@ L5:C10: expected a number after '^', '+' or '-' (no space) | |||
611 | ^ | 611 | ^ |
612 | ]]) | 612 | ]]) |
613 | 613 | ||
614 | testerror([['p'/{1/'q'/&]], [[ | ||
615 | L1:C7: missing closing '}' | ||
616 | 'p'/{1/'q'/& | ||
617 | ^ | ||
618 | L1:C13: expected a pattern after '&' | ||
619 | 'p'/{1/'q'/& | ||
620 | ^ | ||
621 | ]]) | ||
614 | 622 | ||
615 | print 'OK' | 623 | print 'OK' |