Module:Wd/testcases: Difference between revisions

Content deleted Content added
.
Update
Tags: Mobile edit Mobile web edit
 
(214 intermediate revisions by 4 users not shown)
Line 1:
For performance reasons, the test cases have been divided over several subpages:
-- Unit tests for [[Module:Wd]]. Click talk page to run tests.
local p = require('Module:UnitTests')
 
* [[Module:Wd/testcases/1]] – compares the output of [[Module:Wd]] against expected values
function p._test(frame)
* [[Module:Wd/testcases/2]] – compares the output of [[Module:Wd/sandbox]] against expected values
require('Module:Wd')
* [[Module:Wd/testcases/3]] – compares the output of [[Module:Wd/sandbox]] against the output of [[Module:Wd]]
local t = { a = 5, b = 6, };
As of 2023, a new version of testcases is being prepared at [[Module:Wd/sandbox/testcases]].
loadSubmodules(frame)
return mw.dumpObject(copyTable(t)) .. "\n\n" ..
frame:getTitle() .. "\n\n" ..
errorText("unknown-data-type")
end
 
function p:test()
self:preprocess_equals('{{#invoke:Wd|property }}', '')
self:preprocess_equals('{{#invoke:Wd|property | hello}}', '')
self:preprocess_equals('{{#invoke:Wd|_property }}', '')
self:preprocess_equals('{{#invoke:Wd|_property | hello}}', '')
self:preprocess_equals('{{#invoke:Wd/testcases|_test | hello}}', '')
end
 
return p