Jump to content

Module:Escape/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Codehydro (talk | contribs) at 19:30, 14 January 2015. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local p = require('Module:UnitTests')

function p.test_string()
 return 'test, \\test, \\{,test\\\\ \\\\ \\\\\\\\'
end

function p.test_string2()
 return 'test { test {\\{ test, \\test, \\{,test\\ \\ \\ {\\'
end

function p.test_string_module(frame)
 return (p['test_string' .. (frame.args[1] or '')]():gsub('\\', '\\\\'))
end

return p