Module:Redirect template handler/testcases

From wikiNonStop
Revision as of 09:24, 25 August 2024 by Majestix (talk | contribs) (1 revision imported: initial setup)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
-- Unit tests for [[Module:Redirect template handler]]. Click talk page to run tests.
local p = require('Module:UnitTests')

-- Example unit test.
function p:test_song()
	self:preprocess_equals_sandbox_many('{{#invoke:Redirect template handler', 'setSongRedirect', {
	{"test=yes", "R from song, R to anchor, R with possibilities, R printworthy"},
	{"test=yes|test_title=Bulletproof Love (song)", "R from song, R to anchor, R with possibilities, R printworthy"},
	{"test=yes|test_title=Bulletproof Love (Method Man song)", "R from song, R to anchor, R with possibilities, R printworthy"},
	{"test=yes|test_title=It's a Small World (After All)|dab_exception=yes", "R from song, R to anchor, R with Wikidata item, R with possibilities, R printworthy"},
    }, {nowiki=1})
end


return p