summaryrefslogtreecommitdiff
path: root/tests/test-suite
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-suite')
-rw-r--r--tests/test-suite/inprogress/pm.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test-suite/inprogress/pm.js b/tests/test-suite/inprogress/pm.js
index 358910c..d54a848 100644
--- a/tests/test-suite/inprogress/pm.js
+++ b/tests/test-suite/inprogress/pm.js
@@ -402,6 +402,11 @@ test("[test-suite] pm: gsub isbalanced", function (t) {
test("[test-suite] pm: capture", function (t) {
let luaCode = `
+ local function checkerror (msg, f, ...)
+ local s, err = pcall(f, ...)
+ assert(not s and string.find(err, msg))
+ end
+
local t = {"apple", "orange", "lime"; n=0}
assert(string.gsub("x and x and x", "x", function () t.n=t.n+1; return t[t.n] end)
== "apple and orange and lime")