diff options
-rw-r--r-- | testlabel.lua | 18 |
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) | |||
180 | r, l, serror = p:match("") | 180 | r, l, serror = p:match("") |
181 | assert(r == nil and l == 0 and serror == "") | 181 | assert(r == nil and l == 0 and serror == "") |
182 | 182 | ||
183 | -- testing the limit of labels | ||
184 | p = m.T(0) | ||
185 | s = "abc" | ||
186 | r, l, serror = p:match(s) | ||
187 | assert(r == nil and l == 0 and serror == "abc") | ||
188 | |||
189 | p = m.T(255) | ||
190 | s = "abc" | ||
191 | r, l, serror = p:match(s) | ||
192 | assert(r == nil and l == 255 and serror == "abc") | ||
193 | |||
194 | local r = pcall(m.T, -1) | ||
195 | assert(r == false) | ||
196 | |||
197 | local r = pcall(m.T, 256) | ||
198 | assert(r == false) | ||
199 | |||
200 | |||
183 | print("+") | 201 | print("+") |
184 | 202 | ||
185 | --[[ grammar based on Figure 8 of paper submitted to SCP | 203 | --[[ grammar based on Figure 8 of paper submitted to SCP |