Module:EFloras/testcases

local p = require("Module:UnitTests") local eFloras = require "Module:eFloras"

function p:test_italicize local examples = { { "Symphyotrichum novae-angliae", "Symphyotrichum novae-angliae" }, { "Mummenhoffia alliaceae", "Mummenhoffia alliaceae" }, { "Rubus aliceae", "Rubus aliceae" }, { "Cypripedium reginae", "Cypripedium reginae" }, { "Aster ericoides var. ericoides", "Aster ericoides var. ericoides" }, {			"Fragaria vesca subsp. vesca f. semperflorens", "Fragaria vesca subsp. vesca f. semperflorens" },		{ "Fragaria × ananassa", "Fragaria × ananassa" }, { "Populus sect. Tacamahaca", "Populus sect. Tacamahaca" }, { "Populus Sect. Tacamahaca", "Populus Sect. Tacamahaca" }, { "Rosaceae", "Rosaceae" }, { "Fumarioideae", "Fumarioideae" }, { "Astereae", "Astereae" }, { "Asterinae", "Asterinae" }, "Ignores italics and bolding", {			"Fragaria vesca subsp. vesca f. semperflorens", "Fragaria vesca subsp. vesca f. semperflorens" },		{			"Fragaria vesca subsp. vesca f. semperflorens", "Fragaria vesca subsp. vesca f. semperflorens" },		"Returns unparsable input unchanged", { "Fragaria vesca L.", "Fragaria vesca L." },		{ "Cypripedium reginae Walter", "Cypripedium reginae Walter" }, {			"Cypripedium parviflorum Salisb. var. pubescens (Willd.) Knight", "Cypripedium parviflorum Salisb. var. pubescens (Willd.) Knight" },		{ "Prunus virginiana L. 1753 not DuRoi 1771", "Prunus virginiana L. 1753 not DuRoi 1771" }, { "", "" },		{ "Blah blah!! @x?* edf", "Blah blah!! @x?* edf" }, }	local options -- = { nowiki = true } self:iterate(		examples,		function (self, input, expected)			self:equals(input, eFloras.italicize(input), expected, options)		end) end

return p