aboutsummaryrefslogtreecommitdiff
path: root/testes/pm.lua
diff options
context:
space:
mode:
Diffstat (limited to 'testes/pm.lua')
-rw-r--r--testes/pm.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/testes/pm.lua b/testes/pm.lua
index 720d2a35..feab33db 100644
--- a/testes/pm.lua
+++ b/testes/pm.lua
@@ -347,6 +347,16 @@ do -- init parameter in gmatch
347end 347end
348 348
349 349
350do -- bug since 5.3
351 local N = 20000
352 local iter = string.gmatch(string.rep("a", N), string.rep("a?", N))
353 pcall(iter) -- error for pattern too complex
354 -- calling function again found recursion count ('matchdepth') equal
355 -- to -1, so it did not detect next C-stack overflow
356 pcall(iter)
357end
358
359
350-- tests for `%f' (`frontiers') 360-- tests for `%f' (`frontiers')
351 361
352assert(string.gsub("aaa aa a aaa a", "%f[%w]a", "x") == "xaa xa x xaa x") 362assert(string.gsub("aaa aa a aaa a", "%f[%w]a", "x") == "xaa xa x xaa x")