aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUndecidable Robot <undecidabot@gmail.com>2016-05-30 23:02:11 +0800
committerUndecidable Robot <undecidabot@gmail.com>2016-05-30 23:02:11 +0800
commit2fa6d9b25eb2fec85f9c1e9f67189b9b85ffa76b (patch)
tree105200c83009d4f192c15abad85af5e4aa45fcff
parent986072fa5423fc8562caabf6b6afcf4172e45aa4 (diff)
downloadlpeglabel-2fa6d9b25eb2fec85f9c1e9f67189b9b85ffa76b.tar.gz
lpeglabel-2fa6d9b25eb2fec85f9c1e9f67189b9b85ffa76b.tar.bz2
lpeglabel-2fa6d9b25eb2fec85f9c1e9f67189b9b85ffa76b.zip
Slightly adjusting tests
-rw-r--r--testerrors.lua26
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)
18end 18end
19 19
20testerror([[~]],[[ 20testerror([[~]], [[
21L1:C1: no pattern found 21L1: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]], [[
472L1:C18: missing closing ')' 472L1: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]], [[
485name 'nosuch' undefined 485name 'nosuch' undefined
486name 'def' undefined 486name '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]], [[
503name 'nosuch' undefined 503name 'nosuch' undefined
504name 'def' undefined 504name '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)
543testerror([[ 543testerror([[
544 S <- 'forgot to close / T 544 S <- 'forgot to close / T
545 T <- 'T' & / 't' 545 T <- 'T' & / 't'
546]],[[ 546]], [[
547L1:C8: missing terminating single quote 547L1: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 '&'
555testerror([[ 555testerror([[
556 S <- [a-z / T 556 S <- [a-z / T
557 T <- 'x' / & / 'y' 557 T <- 'x' / & / 'y'
558]],[[ 558]], [[
559L1:C8: missing closing ']' 559L1: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
567testerror([[ 567testerror([[
568 S <- ('p' -- comment 568 S <- ('p' -- comment
569]],[[ 569]], [[
570L1:C12: missing closing ')' 570L1: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]], [[
582L1:C9: missing terminating single quote 582L1: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]], [[
597L1:C14: expected at least one label after '{' 597L1: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
614testerror([['p'/{1/'q'/&]], [[
615L1:C7: missing closing '}'
616'p'/{1/'q'/&
617 ^
618L1:C13: expected a pattern after '&'
619'p'/{1/'q'/&
620 ^
621]])
614 622
615print 'OK' 623print 'OK'