Module:Escape/testcases: Difference between revisions
Appearance
hp>Codehydro m remove nowiki |
Humanipedia (talk | contribs) m 1 revision imported |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
= | p = {} | ||
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 | |||
function p.test_kill500(frame) | |||
local esc = require('Module:Escape') | |||
for k = 1, 500 do | |||
local v = esc:kill(p.test_string2(), 'test') | |||
end | |||
return os.clock(esc) | |||
end | |||
return p | |||
Latest revision as of 21:11, 3 February 2025
Documentation for this module may be created at Module:Escape/testcases/doc
p = {}
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
function p.test_kill500(frame)
local esc = require('Module:Escape')
for k = 1, 500 do
local v = esc:kill(p.test_string2(), 'test')
end
return os.clock(esc)
end
return p