Module:Escape/testcases: Difference between revisions
Appearance
Content deleted Content added
speed benchmark |
mNo edit summary |
||
Line 16: | Line 16: | ||
local esc = require('Module:Escape') |
local esc = require('Module:Escape') |
||
for k = 1, 500 do |
for k = 1, 500 do |
||
local v = esc:kill(p. |
local v = esc:kill(p.test_string2(), 'test') |
||
end |
end |
||
return os.clock(esc) |
return os.clock(esc) |
Latest revision as of 20:45, 15 January 2015
![]() | This is the test cases page for the module Module:Escape. Results of the test cases. |
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