Module:Sortable string/testcases

From Wikisource
Jump to navigation Jump to search
local p = require('Module:UnitTests')

function p:test_sortableString()
	self:preprocess_equals_many('{{#invoke:Sortable string|sortable_string|', '}}', {
		{'Book Title', 'Book Title'},
		{'A Book Title', 'Book Title, A'},
		{'An Amazing Book Title', 'Amazing Book Title, An'},
		{'The Book Title', 'Book Title, The'},
		{'The Æther', 'Aether, The'},
		-- but A/An- as a prefix is not changed
		{'And another thing', 'And another thing'},
		{'An-ti', 'An-ti' },
		{'ABC', 'ABC' },
		{'Therapy', 'Therapy'},
	})
end

return p