test/functional/helpers.lua: Fix dedent() #4735

The character class %s also matches a newline in lua, that's not really what we
want here. It works in the other cases in this function, so I left them, but
the final gsub should preserve newlines.
This commit is contained in:
KillTheMule 2016-05-10 22:52:44 +02:00 committed by Justin M. Keyes
parent a524200ca7
commit 48b2faead8

View File

@ -176,7 +176,7 @@ local function dedent(str)
return str return str
end end
-- create a pattern for the indent -- create a pattern for the indent
indent = indent:gsub('%s', '%%s') indent = indent:gsub('%s', '[ \t]')
-- strip it from the first line -- strip it from the first line
str = str:gsub('^'..indent, '') str = str:gsub('^'..indent, '')
-- strip it from the remaining lines -- strip it from the remaining lines