Jump to content

Module:Infobox television disambiguation check/testcases

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

function p:test_main()
	self:preprocess_equals_many('{{#invoke:Infobox television disambiguation check|main|', '}}', {
		{'', "Debug: Error: Empty title.", "Debug: Using a valid format."},
		{'Lost', "Debug: No disambiguation.", "Debug: Using a valid format."},
		{'Lost (TV series)', "Debug: Using a valid format."},
		{'Lost (TV program)', "Debug: Using a valid format."},
		{'Lost (TV programme)', "Debug: Using a valid format."},
		{'Lost (TV film)', "Debug: Using a valid format."},
		{'Lost (film)', "Debug: Using a valid format."},
		{'Lost (miniseries)', "Debug: Using a valid format."},
		{'Lost (serial)', "Debug: Using a valid format."},
		{'Lost (game show)', "Debug: Using a valid format."},
		{'Lost (talk show)', "Debug: Using a valid format."},
		{'Lost (web series)', "Debug: Using a valid format."},
		{'The (206)', "Debug: Title on exception list."},
		{'Cinderella (Apakah Cinta Hanyalah Mimpi?)', "Debug: Title on exception list."},
		{'How to Live with Your Parents (For the Rest of Your Life)', "Debug: Title on exception list."},
		{'I (Almost) Got Away With It', "Debug: Title on exception list."},
		{'Monty Python: Almost the Truth (Lawyers Cut)', "Debug: Title on exception list."},
		{'Randall and Hopkirk (Deceased)', "Debug: Title on exception list."}
	})
end

function p:test_sandbox_main()
	self:preprocess_equals_many('{{#invoke:Infobox television disambiguation check/sandbox|main|', '}}', {
		{''},
		{'Lost'},
		{'Lost (TV series)'},
		{'Lost (TV program)'},
		{'Lost (TV programme)'},
		{'Lost (TV film)'},
		{'Lost (film)'},
		{'Lost (miniseries)'},
		{'Lost (serial)'},
		{'Lost (game show)'},
		{'Lost (talk show)'},
		{'Lost (web series)'},
		{'The (206)'},
		{'Cinderella (Apakah Cinta Hanyalah Mimpi?)'},
		{'How to Live with Your Parents (For the Rest of Your Life)'},
		{'I (Almost) Got Away With It'},
		{'Monty Python: Almost the Truth (Lawyers Cut)'},
		{'Randall and Hopkirk (Deceased)'}
	})
end

return p