diff options
| author | Sergio Queiroz <sqmedeiros@gmail.com> | 2016-12-16 11:02:27 -0300 |
|---|---|---|
| committer | Sergio Queiroz <sqmedeiros@gmail.com> | 2016-12-16 11:02:27 -0300 |
| commit | 85ec338beacb7d9e25ff27205d7c05723e173edd (patch) | |
| tree | 038f90a98b08f69b09cdbbf25f0359fcb2517f62 | |
| parent | 98e54ce388233170cd3a3feb2bcc4449670ccabc (diff) | |
| download | lpeglabel-85ec338beacb7d9e25ff27205d7c05723e173edd.tar.gz lpeglabel-85ec338beacb7d9e25ff27205d7c05723e173edd.tar.bz2 lpeglabel-85ec338beacb7d9e25ff27205d7c05723e173edd.zip | |
Updating tests of 'relabel' syntax
| -rw-r--r-- | testrelabelparser.lua | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/testrelabelparser.lua b/testrelabelparser.lua index 1f1a8cf..3f3ad41 100644 --- a/testrelabelparser.lua +++ b/testrelabelparser.lua | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | local re = require 'relabel' | 1 | local re = require 'relabelrec' |
| 2 | 2 | ||
| 3 | function testerror(repatt, msg) | 3 | function testerror(repatt, msg) |
| 4 | msg = msg:match("^%s*(.-)%s*$") -- trim | 4 | msg = msg:match("^%s*(.-)%s*$") -- trim |
| @@ -53,26 +53,26 @@ L1:C5: unexpected characters after the pattern | |||
| 53 | 53 | ||
| 54 | -- testing ExpPatt1 | 54 | -- testing ExpPatt1 |
| 55 | 55 | ||
| 56 | testerror([['p' /{1}]], [[ | 56 | testerror([['p' //{1}]], [[ |
| 57 | L1:C9: expected a pattern after '/' or the label(s) | 57 | L1:C10: expected a pattern after '/' or '//{...}' |
| 58 | 'p' /{1} | 58 | 'p' //{1} |
| 59 | ^ | 59 | ^ |
| 60 | ]]) | 60 | ]]) |
| 61 | 61 | ||
| 62 | testerror([['p' /{1} /{2} 'q']], [[ | 62 | testerror([['p' //{1} //{2} 'q']], [[ |
| 63 | L1:C9: expected a pattern after '/' or the label(s) | 63 | L1:C10: expected a pattern after '/' or '//{...}' |
| 64 | 'p' /{1} /{2} 'q' | 64 | 'p' //{1} //{2} 'q' |
| 65 | ^ | 65 | ^ |
| 66 | ]]) | 66 | ]]) |
| 67 | 67 | ||
| 68 | testerror([['p' /]], [[ | 68 | testerror([['p' /]], [[ |
| 69 | L1:C6: expected a pattern after '/' or the label(s) | 69 | L1:C6: expected a pattern after '/' or '//{...}' |
| 70 | 'p' / | 70 | 'p' / |
| 71 | ^ | 71 | ^ |
| 72 | ]]) | 72 | ]]) |
| 73 | 73 | ||
| 74 | testerror([['p' / / 'q']], [[ | 74 | testerror([['p' / / 'q']], [[ |
| 75 | L1:C6: expected a pattern after '/' or the label(s) | 75 | L1:C6: expected a pattern after '/' or '//{...}' |
| 76 | 'p' / / 'q' | 76 | 'p' / / 'q' |
| 77 | ^ | 77 | ^ |
| 78 | ]]) | 78 | ]]) |
| @@ -351,10 +351,10 @@ L1:C2: expected the name of a rule after '<' (no space) | |||
| 351 | 351 | ||
| 352 | -- testing ExpLab1 | 352 | -- testing ExpLab1 |
| 353 | 353 | ||
| 354 | testerror([['p' /{} 'q']], [[ | 354 | testerror([['p' //{} 'q']], [[ |
| 355 | L1:C7: expected at least one label after '{' | 355 | L1:C8: expected at least one label after '{' |
| 356 | 'p' /{} 'q' | 356 | 'p' //{} 'q' |
| 357 | ^ | 357 | ^ |
| 358 | ]]) | 358 | ]]) |
| 359 | 359 | ||
| 360 | testerror([[%{ 'label' }]], [[ | 360 | testerror([[%{ 'label' }]], [[ |
| @@ -365,10 +365,10 @@ L1:C3: expected at least one label after '{' | |||
| 365 | 365 | ||
| 366 | -- testing ExpLab2 | 366 | -- testing ExpLab2 |
| 367 | 367 | ||
| 368 | testerror([['p' /{1,2,3,} 'q']], [[ | 368 | testerror([['p' //{1,2,3,} 'q']], [[ |
| 369 | L1:C13: expected a label after the comma | 369 | L1:C14: expected a label after the comma |
| 370 | 'p' /{1,2,3,} 'q' | 370 | 'p' //{1,2,3,} 'q' |
| 371 | ^ | 371 | ^ |
| 372 | ]]) | 372 | ]]) |
| 373 | 373 | ||
| 374 | -- testing ExpNameOrLab | 374 | -- testing ExpNameOrLab |
