summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-06-15 01:40:43 +1000
committerdaurnimator <quae@daurnimator.com>2017-06-15 01:40:43 +1000
commit5dd31ddd7032687bbce138f23dcd08bc146942fc (patch)
tree3fec720585026b03546f82b6f00767d854a239f9 /tests
parent61a5284a07d9a9342d192ae6fb4e8e567a3811a9 (diff)
downloadfengari-5dd31ddd7032687bbce138f23dcd08bc146942fc.tar.gz
fengari-5dd31ddd7032687bbce138f23dcd08bc146942fc.tar.bz2
fengari-5dd31ddd7032687bbce138f23dcd08bc146942fc.zip
tests/test-suite/inprogress/pm.js: Add missing checkerror function
Diffstat (limited to 'tests')
-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")