diff options
author | daurnimator <quae@daurnimator.com> | 2017-06-15 01:40:43 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-06-15 01:40:43 +1000 |
commit | 5dd31ddd7032687bbce138f23dcd08bc146942fc (patch) | |
tree | 3fec720585026b03546f82b6f00767d854a239f9 /tests/test-suite/inprogress/pm.js | |
parent | 61a5284a07d9a9342d192ae6fb4e8e567a3811a9 (diff) | |
download | fengari-5dd31ddd7032687bbce138f23dcd08bc146942fc.tar.gz fengari-5dd31ddd7032687bbce138f23dcd08bc146942fc.tar.bz2 fengari-5dd31ddd7032687bbce138f23dcd08bc146942fc.zip |
tests/test-suite/inprogress/pm.js: Add missing checkerror function
Diffstat (limited to 'tests/test-suite/inprogress/pm.js')
-rw-r--r-- | tests/test-suite/inprogress/pm.js | 5 |
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") |