diff options
author | Undecidable Robot <undecidabot@gmail.com> | 2016-05-30 18:07:47 +0800 |
---|---|---|
committer | Undecidable Robot <undecidabot@gmail.com> | 2016-05-30 18:07:47 +0800 |
commit | 1650d2c9f3672609e47a62fa0c63a792ee311926 (patch) | |
tree | 8ed7f7eecc50cc7481d7bd9076d3e88316f9d2f8 /testerrors.lua | |
parent | 9ecfcf1a4b79b508e32776a0b1c014978569b526 (diff) | |
download | lpeglabel-1650d2c9f3672609e47a62fa0c63a792ee311926.tar.gz lpeglabel-1650d2c9f3672609e47a62fa0c63a792ee311926.tar.bz2 lpeglabel-1650d2c9f3672609e47a62fa0c63a792ee311926.zip |
Fixing error checking spacing issue
Diffstat (limited to 'testerrors.lua')
-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') |