Difference between revisions of "Module:Sort title/testcases"

From blackwiki
Jump to navigation Jump to search
blackwiki>Gonnym
blackwiki>Gonnym
Line 14: Line 14:
 
{'4,722 Hours', "4722 Hours"},
 
{'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.)"},
 
{'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
 
end
Line 31: Line 29:
 
{'4,722 Hours', "4722 Hours"},
 
{'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.)"},
 
{'4,722 Hours (Agents of S.H.I.E.L.D.)', "4722 Hours (Agents of S.H.I.E.L.D.)"},
 +
})
 +
end
 +
 +
function p:test_3_testcases_live()
 +
self:preprocess_equals_many('{{#invoke:Sort title|testcases|', '}}', {
 +
{'A', "A"},
 +
{'An', "An"},
 +
{'The', "The"},
 +
{'A (Dab)', "A (Dab)"},
 +
{'A (A)', "A (A)"},
 +
{'A Title', "Title, A"},
 +
{'A Title (Dab)', "Title, A (Dab)"},
 +
{'A Title (A Dab)', "Title, A (Dab, A)"},
 +
{'Title (Dab)', "Title (Dab)"},
 +
{'Title (A Dab)', "Title (Dab, A)"},
 +
{'The Title', "Title, The"},
 +
{'An Egg', "Egg, An"},
 +
{'A. B. and C.', "A. B. and C."},
 +
{'\'A\' Title', "\'A\' Title"},
 +
{'A, My Name', "A, My Name"},
 +
{'...Title', "...Title"},
 +
{'...A Title', "...A Title"},
 +
{'4,722 Hours', "4722 Hours"}
 +
})
 +
end
 +
 +
function p:test_4_testcases_live()
 +
self:preprocess_equals_many('{{#invoke:Sort title/sandbox|testcases|', '}}', {
 +
{'A', "A"},
 +
{'An', "An"},
 +
{'The', "The"},
 +
{'A (Dab)', "A (Dab)"},
 +
{'A (A)', "A (A)"},
 +
{'A Title', "Title, A"},
 +
{'A Title (Dab)', "Title, A (Dab)"},
 +
{'A Title (A Dab)', "Title, A (Dab, A)"},
 +
{'Title (Dab)', "Title (Dab)"},
 +
{'Title (A Dab)', "Title (Dab, A)"},
 +
{'The Title', "Title, The"},
 +
{'An Egg', "Egg, An"},
 
{'A. B. and C.', "A. B. and C."},
 
{'A. B. and C.', "A. B. and C."},
{'A (The Walking Dead)', "A (Walking Dead, The)"}
+
{'\'A\' Title', "\'A\' Title"},
 +
{'A, My Name', "A, My Name"},
 +
{'...Title', "...Title"},
 +
{'...A Title', "...A Title"},
 +
{'4,722 Hours', "4722 Hours"}
 
})
 
})
 
end
 
end
  
 
return p
 
return p

Revision as of 20:26, 8 July 2019

Documentation for this module may be created at Module:Sort title/testcases/doc

-- 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.)"},
	})
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

function p:test_3_testcases_live()
	self:preprocess_equals_many('{{#invoke:Sort title|testcases|', '}}', {
		{'A', "A"},
		{'An', "An"},
		{'The', "The"},
		{'A (Dab)', "A (Dab)"},
		{'A (A)', "A (A)"},
		{'A Title', "Title, A"},
		{'A Title (Dab)', "Title, A (Dab)"},
		{'A Title (A Dab)', "Title, A (Dab, A)"},
		{'Title (Dab)', "Title (Dab)"},
		{'Title (A Dab)', "Title (Dab, A)"},
		{'The Title', "Title, The"},		
		{'An Egg', "Egg, An"},		
		{'A. B. and C.', "A. B. and C."},
		{'\'A\' Title', "\'A\' Title"},
		{'A, My Name', "A, My Name"},
		{'...Title', "...Title"},
		{'...A Title', "...A Title"},
		{'4,722 Hours', "4722 Hours"}
	})
end

function p:test_4_testcases_live()
	self:preprocess_equals_many('{{#invoke:Sort title/sandbox|testcases|', '}}', {
		{'A', "A"},
		{'An', "An"},
		{'The', "The"},
		{'A (Dab)', "A (Dab)"},
		{'A (A)', "A (A)"},
		{'A Title', "Title, A"},
		{'A Title (Dab)', "Title, A (Dab)"},
		{'A Title (A Dab)', "Title, A (Dab, A)"},
		{'Title (Dab)', "Title (Dab)"},
		{'Title (A Dab)', "Title (Dab, A)"},
		{'The Title', "Title, The"},		
		{'An Egg', "Egg, An"},		
		{'A. B. and C.', "A. B. and C."},
		{'\'A\' Title', "\'A\' Title"},
		{'A, My Name', "A, My Name"},
		{'...Title', "...Title"},
		{'...A Title', "...A Title"},
		{'4,722 Hours', "4722 Hours"}
	})
end

return p