From 5dd31ddd7032687bbce138f23dcd08bc146942fc Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 15 Jun 2017 01:40:43 +1000 Subject: tests/test-suite/inprogress/pm.js: Add missing checkerror function --- tests/test-suite/inprogress/pm.js | 5 +++++ 1 file changed, 5 insertions(+) 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") -- cgit v1.2.3-54-g00ecf