aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Queiroz <sqmedeiros@gmail.com>2016-12-16 11:02:27 -0300
committerSergio Queiroz <sqmedeiros@gmail.com>2016-12-16 11:02:27 -0300
commit85ec338beacb7d9e25ff27205d7c05723e173edd (patch)
tree038f90a98b08f69b09cdbbf25f0359fcb2517f62
parent98e54ce388233170cd3a3feb2bcc4449670ccabc (diff)
downloadlpeglabel-85ec338beacb7d9e25ff27205d7c05723e173edd.tar.gz
lpeglabel-85ec338beacb7d9e25ff27205d7c05723e173edd.tar.bz2
lpeglabel-85ec338beacb7d9e25ff27205d7c05723e173edd.zip
Updating tests of 'relabel' syntax
-rw-r--r--testrelabelparser.lua38
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 @@
1local re = require 'relabel' 1local re = require 'relabelrec'
2 2
3function testerror(repatt, msg) 3function 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
56testerror([['p' /{1}]], [[ 56testerror([['p' //{1}]], [[
57L1:C9: expected a pattern after '/' or the label(s) 57L1:C10: expected a pattern after '/' or '//{...}'
58'p' /{1} 58'p' //{1}
59 ^ 59 ^
60]]) 60]])
61 61
62testerror([['p' /{1} /{2} 'q']], [[ 62testerror([['p' //{1} //{2} 'q']], [[
63L1:C9: expected a pattern after '/' or the label(s) 63L1:C10: expected a pattern after '/' or '//{...}'
64'p' /{1} /{2} 'q' 64'p' //{1} //{2} 'q'
65 ^ 65 ^
66]]) 66]])
67 67
68testerror([['p' /]], [[ 68testerror([['p' /]], [[
69L1:C6: expected a pattern after '/' or the label(s) 69L1:C6: expected a pattern after '/' or '//{...}'
70'p' / 70'p' /
71 ^ 71 ^
72]]) 72]])
73 73
74testerror([['p' / / 'q']], [[ 74testerror([['p' / / 'q']], [[
75L1:C6: expected a pattern after '/' or the label(s) 75L1: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
354testerror([['p' /{} 'q']], [[ 354testerror([['p' //{} 'q']], [[
355L1:C7: expected at least one label after '{' 355L1:C8: expected at least one label after '{'
356'p' /{} 'q' 356'p' //{} 'q'
357 ^ 357 ^
358]]) 358]])
359 359
360testerror([[%{ 'label' }]], [[ 360testerror([[%{ 'label' }]], [[
@@ -365,10 +365,10 @@ L1:C3: expected at least one label after '{'
365 365
366-- testing ExpLab2 366-- testing ExpLab2
367 367
368testerror([['p' /{1,2,3,} 'q']], [[ 368testerror([['p' //{1,2,3,} 'q']], [[
369L1:C13: expected a label after the comma 369L1: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