diff options
-rw-r--r-- | testerrors.lua | 14 |
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([[[^] ]], [[ | 374 | testerror([[[^] ]], [[ |
375 | -- L1:C1: missing closing ']' | 375 | L1:C1: missing closing ']' |
376 | -- [^] | 376 | [^] |
377 | -- ^ | 377 | ^ |
378 | -- ]]) | 378 | ]]) |
379 | 379 | ||
380 | testerror([[[_-___-_|]], [[ | 380 | testerror([[[_-___-_|]], [[ |
381 | L1:C1: missing closing ']' | 381 | L1:C1: missing closing ']' |
@@ -513,8 +513,6 @@ L1:C23: missing closing ')' | |||
513 | name 'nosuch' undefined | 513 | name 'nosuch' undefined |
514 | ]]) | 514 | ]]) |
515 | 515 | ||
516 | -- testerror([[A <- Unknown Rules]], [[]]) | ||
517 | |||
518 | testerror([['a' / &@ ('c' / 'd')]], [[ | 516 | testerror([['a' / &@ ('c' / 'd')]], [[ |
519 | L1:C8: expected a pattern after '&' | 517 | L1:C8: expected a pattern after '&' |
520 | 'a' / &@ ('c' / 'd') | 518 | 'a' / &@ ('c' / 'd') |