aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r--test/functional/helpers.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index d7858cacd5..f4b2a8dfdc 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -319,7 +319,14 @@ end
-- Dedent the given text and write it to the file name.
local function write_file(name, text, dont_dedent)
local file = io.open(name, 'w')
- if not dont_dedent then
+ if type(text) == 'table' then
+ -- Byte blob
+ local bytes = text
+ text = ''
+ for _, char in ipairs(bytes) do
+ text = ('%s%c'):format(text, char)
+ end
+ elseif not dont_dedent then
text = dedent(text)
end
file:write(text)