aboutsummaryrefslogtreecommitdiff
path: root/test.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-04-27 10:32:39 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-04-27 10:32:39 -0300
commit012cf9c86cf91cb8354e229bde335592d41b84b2 (patch)
tree353f17797b1952eaec231c8e4fd5c21e02daf875 /test.lua
parent3403b0c7256435560b63f828da92026c5d4c898b (diff)
downloadlpeg-012cf9c86cf91cb8354e229bde335592d41b84b2.tar.gz
lpeg-012cf9c86cf91cb8354e229bde335592d41b84b2.tar.bz2
lpeg-012cf9c86cf91cb8354e229bde335592d41b84b2.zip
Compact charsets used in trees, too.
Diffstat (limited to 'test.lua')
-rwxr-xr-xtest.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/test.lua b/test.lua
index d76e3f1..9f8d226 100755
--- a/test.lua
+++ b/test.lua
@@ -68,6 +68,8 @@ assert(m.match(#m.P(true) * "a", "a") == 2)
68assert(m.match("a" * #m.P(false), "a") == nil) 68assert(m.match("a" * #m.P(false), "a") == nil)
69assert(m.match("a" * #m.P(true), "a") == 2) 69assert(m.match("a" * #m.P(true), "a") == 2)
70 70
71assert(m.match(m.P(1)^0, "abcd") == 5)
72assert(m.match(m.S("")^0, "abcd") == 1)
71 73
72-- tests for locale 74-- tests for locale
73do 75do
@@ -1167,7 +1169,7 @@ end
1167 1169
1168 1170
1169-- bug in 1.0: problems with math-times returning too many captures 1171-- bug in 1.0: problems with math-times returning too many captures
1170do 1172if _VERSION >= "Lua 5.2" then
1171 local lim = 2^11 - 10 1173 local lim = 2^11 - 10
1172 local res = {m.match(manyCmt(lim), "a")} 1174 local res = {m.match(manyCmt(lim), "a")}
1173 assert(#res == lim and res[1] == lim - 1 and res[lim] == 0) 1175 assert(#res == lim and res[1] == lim - 1 and res[lim] == 0)