-- Unit tests for [[Module:Compact list]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test()
	self:preprocess_equals_preprocess('{{#invoke:Compact list|main|ook|xxx=111}}','')
	self:preprocess_equals_preprocess('{{#invoke:Compact list|main|ook|ook=A|spud=1234}}','A')
	self:preprocess_equals_preprocess('{{#invoke:Compact list|main|ook|ook1=A|ook_2=B}}','{{hlist|A|B}}')
	self:preprocess_equals_preprocess('{{#invoke:Compact list|main|ook|ook=A|ook0=B|ook30=C|fook=234}}','{{hlist|A|B|C}}')
	self:preprocess_equals_preprocess('{{#invoke:Compact list|main|ook|ook=A|ook1=B|ook2=C|ook3=D}}','{{hlist|A|B|C|D}}')
	self:preprocess_equals_preprocess('{{#invoke:Compact list|main|ook|ook1=A|ook5=B|ook20=C|ook3000=D|ook342345=E|ook234ttthh=234}}',
		'{{collapsible list|A|B|C|D|E}}')
	self:preprocess_equals_preprocess('{{#invoke:Compact list|main|ook|ook1=A|ook5=B|ook20=C|ook3000=D|ook342345=E|ook234ttthh=234|_limit=5}}',
		'{{hlist|A|B|C|D|E}}')
	self:preprocess_equals_preprocess('{{#invoke:Compact list|main|ook|ook=A|ook1=B|ook2=C|ook3=D|ook4=E|ook5=F|ook6=G|ook7=H|ook8=I|ook9=J}}',
		'{{collapsible list|A|B|C|D|E|F|G|H|I|J}}')
end

return p