aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testerrors.lua14
1 files changed, 6 insertions, 8 deletions
diff --git a/testerrors.lua b/testerrors.lua
index afa80c6..505d288 100644
--- a/testerrors.lua
+++ b/testerrors.lua
@@ -5,7 +5,7 @@ function testerror(repatt, msg)
5 local ok, err = pcall(function () re.compile(repatt) end) 5 local ok, err = pcall(function () re.compile(repatt) end)
6 assert(not ok) 6 assert(not ok)
7 err = err:match("^[^\n]*\n(.-)$") -- remove first line (filename) 7 err = err:match("^[^\n]*\n(.-)$") -- remove first line (filename)
8 err = err:gsub(" *\n", "\n") -- remove trailing spaces 8 err = err:gsub("[ \t]*\n", "\n") -- remove trailing spaces
9 -- if err ~= msg then 9 -- if err ~= msg then
10 -- print(#err, #msg) 10 -- print(#err, #msg)
11 -- print('--') 11 -- print('--')
@@ -371,11 +371,11 @@ L1:C1: missing closing ']'
371^ 371^
372]]) 372]])
373 373
374-- testerror([[[^] ]], [[ 374testerror([[[^] ]], [[
375-- L1:C1: missing closing ']' 375L1:C1: missing closing ']'
376-- [^] 376[^]
377-- ^ 377^
378-- ]]) 378]])
379 379
380testerror([[[_-___-_|]], [[ 380testerror([[[_-___-_|]], [[
381L1:C1: missing closing ']' 381L1:C1: missing closing ']'
@@ -513,8 +513,6 @@ L1:C23: missing closing ')'
513name 'nosuch' undefined 513name 'nosuch' undefined
514]]) 514]])
515 515
516-- testerror([[A <- Unknown Rules]], [[]])
517
518testerror([['a' / &@ ('c' / 'd')]], [[ 516testerror([['a' / &@ ('c' / 'd')]], [[
519L1:C8: expected a pattern after '&' 517L1:C8: expected a pattern after '&'
520'a' / &@ ('c' / 'd') 518'a' / &@ ('c' / 'd')