Jump to content

Module:Sort title/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Gonnym (talk | contribs) at 20:14, 8 July 2019. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Unit tests for [[Module:Sort title]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_1_testcases_live()
	self:preprocess_equals_many('{{#invoke:Sort title|testcases|', '}}', {
		{'Lost', "Lost"},
		{'Lost (TV series)', "Lost (TV series)"},
		{'Lost (2004 TV series)', "Lost (2004 TV series)"},
		{'Lost (American TV series)', "Lost (American TV series)"},
		{'The Flash', "Flash, The"},
		{'The Flash (TV series)', "Flash, The (TV series)"},
		{'Pilot (The Flash)', "Pilot (Flash, The)"},
		{'The Trap (The Flash)', "Trap, The (Flash, The)"},
		{'4,722 Hours', "4722 Hours"},
		{'4,722 Hours (Agents of S.H.I.E.L.D.)', "4722 Hours (Agents of S.H.I.E.L.D.)"},
		{'A. B. and C.', "A. B. and C."},
		{'A (The Walking Dead)', "A (Walking Dead, The)"}
	})
end

function p:test_2_testcases_sandbox()
	self:preprocess_equals_many('{{#invoke:Sort title/sandbox|testcases|', '}}', {
		{'Lost', "Lost"},
		{'Lost (TV series)', "Lost (TV series)"},
		{'Lost (2004 TV series)', "Lost (2004 TV series)"},
		{'Lost (American TV series)', "Lost (American TV series)"},
		{'The Flash', "Flash, The"},
		{'The Flash (TV series)', "Flash, The (TV series)"},
		{'Pilot (The Flash)', "Pilot (Flash, The)"},
		{'The Trap (The Flash)', "Trap, The (Flash, The)"},
		{'4,722 Hours', "4722 Hours"},
		{'4,722 Hours (Agents of S.H.I.E.L.D.)', "4722 Hours (Agents of S.H.I.E.L.D.)"}
	})
end

return p