aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Queiroz <sqmedeiros@gmail.com>2016-07-01 15:16:49 -0300
committerSergio Queiroz <sqmedeiros@gmail.com>2016-07-01 15:16:49 -0300
commit2937e9cf882d61eb64fccd15ddaf1465643ac201 (patch)
treeadb45665f423c185a4cc8f8747fd178e78a699f6
parent7cd05bfaeea0fc1d269ace114d3225bffbd82940 (diff)
downloadlpeglabel-2937e9cf882d61eb64fccd15ddaf1465643ac201.tar.gz
lpeglabel-2937e9cf882d61eb64fccd15ddaf1465643ac201.tar.bz2
lpeglabel-2937e9cf882d61eb64fccd15ddaf1465643ac201.zip
Adding tests to check the limit of labels
-rw-r--r--testlabel.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/testlabel.lua b/testlabel.lua
index f7180a7..4f0768d 100644
--- a/testlabel.lua
+++ b/testlabel.lua
@@ -180,6 +180,24 @@ assert(p:match("abc") == 2)
180r, l, serror = p:match("") 180r, l, serror = p:match("")
181assert(r == nil and l == 0 and serror == "") 181assert(r == nil and l == 0 and serror == "")
182 182
183-- testing the limit of labels
184p = m.T(0)
185s = "abc"
186r, l, serror = p:match(s)
187assert(r == nil and l == 0 and serror == "abc")
188
189p = m.T(255)
190s = "abc"
191r, l, serror = p:match(s)
192assert(r == nil and l == 255 and serror == "abc")
193
194local r = pcall(m.T, -1)
195assert(r == false)
196
197local r = pcall(m.T, 256)
198assert(r == false)
199
200
183print("+") 201print("+")
184 202
185--[[ grammar based on Figure 8 of paper submitted to SCP 203--[[ grammar based on Figure 8 of paper submitted to SCP