1測試失敗。 (刷新)

文字 預期 實際
test:
Passed PS/2接口 (pì-áisi èr jiēkǒu) PS/2手08口00 PS/2手08口00
Passed 命裡有時終須有,命裡無時莫強求命里有时终须有,命里无时莫强求 口05衣07月02日06糸05頁03月02,口05衣07火08日06艸07弓08水02 口05衣07月02日06糸05頁03月02,口05衣07火08日06艸07弓08水02
Failed ⿺辶⿳穴⿲月⿱⿲幺言幺⿲長馬長刂心⿺辶⿳穴⿲月⿱⿲幺言幺⿲長馬長刂心麵⿺辶⿳穴⿲月⿱⿲幺言幺⿲长马长刂心⿺辶⿳穴⿲月⿱⿲幺言幺⿲长马长刂心面 辵54辵54麥09 ⿺辵00⿳穴00⿲月00⿱⿲幺00言00幺00⿲長00馬00長00刀00心00⿺辵00⿳穴00⿲月00⿱⿲幺00言00幺00⿲長00馬00長00刀00心00麥09

local tests = require("Module:UnitTests")
local makeSortKey = require("Module:zh-sortkey").makeSortKey
local full_link = require("Module:links").full_link
local zh = require("Module:languages").getByCode("zh")

local function link(str)
	return full_link{ term = str, lang = zh }
end

local function code(str)
	return '<code>' .. str .. '</code>'
end

local options = { display = code }
function tests:check(example, expected)
	self:equals(link(example),
		makeSortKey(example),
		expected,
		options)
end

function tests:test()
	local examples = {
		{ "PS/2接口", "PS/2手08口00" },
		{ "命裡有時終須有,命裡無時莫強求", "口05衣07月02日06糸05頁03月02,口05衣07火08日06艸07弓08水02" },
		{ "⿺辶⿳穴⿲月⿱⿲幺言幺⿲長馬長刂心⿺辶⿳穴⿲月⿱⿲幺言幺⿲長馬長刂心麵", "辵54辵54麥09" },
	}
	self:iterate(examples, "check")
end

return tests