コンテンツにスキップ

モジュール:Main/testcases

-- [[Module:Bananas]]のユニットテスト例です。ノートをクリックして動作確認をしてください。
local p = require('Module:UnitTests')

function p:test_01_sandbox_to_original()
    self:preprocess_equals_preprocess('{{#invoke:Main | main|1|2}}', '{{Main|1|2}}', {nowiki=1} )
end

function p:test_01_template_to_template()
    self:preprocess_equals_preprocess('{{Main/sandbox | 1|2}}', '{{Main|1|2}}', {nowiki=1} )
end

local ScribuntoUnit = require('Module:ScribuntoUnit')
local suite = ScribuntoUnit:new()

function p:test_02_modulesandbox_to_original()
	self:preprocess_equals_preprocess_many('{{#invoke:Main/sandbox|main|', '}}', '{{Main|', '}}', {
        {'A| B |:C| :D |Category:E|:Category:F|G#Z|#H|I|l9=Z|en:J|:en:K'},
        {'A{{!}}B'},
        {'{{仮リンク|Template:Expand Japanese|en|Template:Expand Japanese}}'},
        {'A|B||D'}
    },{nowiki=1})
end

return p