aboutsummaryrefslogtreecommitdiff
path: root/test/helpers.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/helpers.lua')
-rw-r--r--test/helpers.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/helpers.lua b/test/helpers.lua
index 10f2f80191..67ac82e6fd 100644
--- a/test/helpers.lua
+++ b/test/helpers.lua
@@ -394,6 +394,11 @@ local function format_string(fmt, ...)
return ret
end
+local function intchar2lua(ch)
+ ch = tonumber(ch)
+ return (20 <= ch and ch < 127) and ('%c'):format(ch) or ch
+end
+
return {
eq = eq,
neq = neq,
@@ -412,4 +417,5 @@ return {
dedent = dedent,
format_luav = format_luav,
format_string = format_string,
+ intchar2lua = intchar2lua,
}