Modul:grammar-link/test

Hej, du har kommit hit för att leta efter betydelsen av ordet Modul:grammar-link/test. I DICTIOUS hittar du inte bara alla ordboksbetydelser av ordet Modul:grammar-link/test, utan du får också veta mer om dess etymologi, dess egenskaper och hur man säger Modul:grammar-link/test i singular och plural. Allt du behöver veta om ordet Modul:grammar-link/test finns här. Definitionen av ordet Modul:grammar-link/test hjälper dig att vara mer exakt och korrekt när du talar eller skriver dina texter. Genom att känna till definitionen avModul:grammar-link/test och andra ord berikar du ditt ordförråd och får tillgång till fler och bättre språkliga resurser.

All tests passed. (refresh)

Text Expected Actual
test01a_basic:
Passed mut.link("form1", "infl") <span data-grammar-link="infl">[]</span> <span data-grammar-link="infl">[]</span>
Passed mut.link(" form1 ", "infl") <span data-grammar-link="infl">[]</span> <span data-grammar-link="infl">[]</span>
Passed mut.link("form1", "infl", "sv") <span data-grammar-link="infl">[[form1#Svenska|form1]]</span> <span data-grammar-link="infl">[[form1#Svenska|form1]]</span>
Passed mut.link("form1", "infl", "sv", "verb) <span class="grammar-inline" data-lang="sv" data-h3="verb"><span data-grammar-link="infl">[[form1#Svenska|form1]]</span></span> <span class="grammar-inline" data-lang="sv" data-h3="verb"><span data-grammar-link="infl">[[form1#Svenska|form1]]</span></span>
Passed mut.link("form1", "adv") <span data-grammar-link="adv">[]</span> <span data-grammar-link="adv">[]</span>
Passed mut.link("form1", "adv", "de") <span data-grammar-link="adv">[[form1#Tyska|form1]]</span> <span data-grammar-link="adv">[[form1#Tyska|form1]]</span>
Passed mut.link("form1", "adv", "de", "verb) <span class="grammar-inline" data-lang="de" data-h3="verb"><span data-grammar-link="adv">[[form1#Tyska|form1]]</span></span> <span class="grammar-inline" data-lang="de" data-h3="verb"><span data-grammar-link="adv">[[form1#Tyska|form1]]</span></span>
Passed mut.link("form1", "perfpart") <span data-grammar-link="perfpart">[]</span> <span data-grammar-link="perfpart">[]</span>
Passed mut.link("form1", "perfpart", "en") <span data-grammar-link="perfpart">[[form1#Engelska|form1]]</span> <span data-grammar-link="perfpart">[[form1#Engelska|form1]]</span>
Passed mut.link("form1", "perfpart", "en", "verb) <span class="grammar-inline" data-lang="en" data-h3="verb"><span data-grammar-link="perfpart">[[form1#Engelska|form1]]</span></span> <span class="grammar-inline" data-lang="en" data-h3="verb"><span data-grammar-link="perfpart">[[form1#Engelska|form1]]</span></span>
Text Expected Actual
test01b_basic_export:
Passed mut.linkExport("form1", "infl") {"form1"} {"form1"}
Passed mut.linkExport("form1", "adv") {"form1"} {"form1"}
Passed mut.linkExport("form1", "perfpart") {"form1"} {"form1"}
Passed mut.linkExport(" form1 ", "infl") {"form1"} {"form1"}
Text Expected Actual
test02a_multiple:
Passed mut.link("form1, form2", "infl") <span data-grammar-link="infl">[]</span>, <span data-grammar-link="infl">[]</span> <span data-grammar-link="infl">[]</span>, <span data-grammar-link="infl">[]</span>
Passed mut.link("form1, form2", "infl", "sv") <span data-grammar-link="infl">[[form1#Svenska|form1]]</span>, <span data-grammar-link="infl">[[form2#Svenska|form2]]</span> <span data-grammar-link="infl">[[form1#Svenska|form1]]</span>, <span data-grammar-link="infl">[[form2#Svenska|form2]]</span>
Passed mut.link("form1, form2", "infl", "sv", "verb) <span class="grammar-inline" data-lang="sv" data-h3="verb"><span data-grammar-link="infl">[[form1#Svenska|form1]]</span>, <span data-grammar-link="infl">[[form2#Svenska|form2]]</span></span> <span class="grammar-inline" data-lang="sv" data-h3="verb"><span data-grammar-link="infl">[[form1#Svenska|form1]]</span>, <span data-grammar-link="infl">[[form2#Svenska|form2]]</span></span>
Passed mut.link("], ]", "infl") <span data-grammar-link="infl">[]</span>, <span data-grammar-link="infl">[]</span> <span data-grammar-link="infl">[]</span>, <span data-grammar-link="infl">[]</span>
Passed mut.link("], ]", "infl", "sv") <span data-grammar-link="infl">[[form1#Svenska|form1]]</span>, <span data-grammar-link="infl">[[form2#Svenska|form2]]</span> <span data-grammar-link="infl">[[form1#Svenska|form1]]</span>, <span data-grammar-link="infl">[[form2#Svenska|form2]]</span>
Passed mut.link("], ]", "infl", "sv", "verb") <span class="grammar-inline" data-lang="sv" data-h3="verb"><span data-grammar-link="infl">[[form1#Svenska|form1]]</span>, <span data-grammar-link="infl">[[form2#Svenska|form2]]</span></span> <span class="grammar-inline" data-lang="sv" data-h3="verb"><span data-grammar-link="infl">[[form1#Svenska|form1]]</span>, <span data-grammar-link="infl">[[form2#Svenska|form2]]</span></span>
Passed mut.link("], form2", "infl") <span data-grammar-link="infl">[]</span>, <span data-grammar-link="infl">[]</span> <span data-grammar-link="infl">[]</span>, <span data-grammar-link="infl">[]</span>
Passed mut.link("], form2", "infl", "sv") <span data-grammar-link="infl">[[form1#Svenska|form1]]</span>, <span data-grammar-link="infl">[[form2#Svenska|form2]]</span> <span data-grammar-link="infl">[[form1#Svenska|form1]]</span>, <span data-grammar-link="infl">[[form2#Svenska|form2]]</span>
Passed mut.link("], form2", "infl", "sv", "verb") <span class="grammar-inline" data-lang="sv" data-h3="verb"><span data-grammar-link="infl">[[form1#Svenska|form1]]</span>, <span data-grammar-link="infl">[[form2#Svenska|form2]]</span></span> <span class="grammar-inline" data-lang="sv" data-h3="verb"><span data-grammar-link="infl">[[form1#Svenska|form1]]</span>, <span data-grammar-link="infl">[[form2#Svenska|form2]]</span></span>
Passed mut.link("form1, ]", "infl") <span data-grammar-link="infl">[]</span>, <span data-grammar-link="infl">[]</span> <span data-grammar-link="infl">[]</span>, <span data-grammar-link="infl">[]</span>
Passed mut.link("form1, ]", "infl", "sv") <span data-grammar-link="infl">[[form1#Svenska|form1]]</span>, <span data-grammar-link="infl">[[form2#Svenska|form2]]</span> <span data-grammar-link="infl">[[form1#Svenska|form1]]</span>, <span data-grammar-link="infl">[[form2#Svenska|form2]]</span>
Passed mut.link("form1, ]", "infl", "sv", "verb") <span class="grammar-inline" data-lang="sv" data-h3="verb"><span data-grammar-link="infl">[[form1#Svenska|form1]]</span>, <span data-grammar-link="infl">[[form2#Svenska|form2]]</span></span> <span class="grammar-inline" data-lang="sv" data-h3="verb"><span data-grammar-link="infl">[[form1#Svenska|form1]]</span>, <span data-grammar-link="infl">[[form2#Svenska|form2]]</span></span>
Text Expected Actual
test02b_multiple_export:
Passed mut.linkExport("form1, form2", "infl") {"form1", "form2"} {"form1", "form2"}
Passed mut.linkExport("], ]", "infl") {"form1", "form2"} {"form1", "form2"}
Passed mut.linkExport("], form2", "infl") {"form1", "form2"} {"form1", "form2"}
Passed mut.linkExport("form1, ]", "infl") {"form1", "form2"} {"form1", "form2"}
Text Expected Actual
test03a_misc:
Passed mut.link("]<sup>1</sup>") <span data-grammar-link="infl">[]</span><sup>1</sup> <span data-grammar-link="infl">[]</span><sup>1</sup>
Passed mut.link("], vard. ]") <span data-grammar-link="infl">[]</span>, vard. <span data-grammar-link="infl">[]</span> <span data-grammar-link="infl">[]</span>, vard. <span data-grammar-link="infl">[]</span>
Passed mut.link("(])") '''('''<span data-grammar-link="infl">[]</span>''')''' '''('''<span data-grammar-link="infl">[]</span>''')'''
Passed mut.link("]") <span data-grammar-link="infl">[[form1|fōrm1]]</span> <span data-grammar-link="infl">[[form1|fōrm1]]</span>
Passed mut.link("]") <span data-grammar-link="infl">[[Övriga_uppslagsord#EU:s|EU:s]]</span> <span data-grammar-link="infl">[[Övriga_uppslagsord#EU:s|EU:s]]</span>
Passed mut.link("<nowiki/>form1, form2")
Med nowiki i modul
<nowiki/>form1, <span data-grammar-link="infl">[]</span> <nowiki/>form1, <span data-grammar-link="infl">[]</span>
Passed mut.link("<nowiki/>form1, form2")
Med nowiki i mall
"`UNIQ--nowiki-00000001-QINU`"'form1, <span data-grammar-link="infl">[]</span> "`UNIQ--nowiki-00000001-QINU`"'form1, <span data-grammar-link="infl">[]</span>
Text Expected Actual
test03b_misc_export:
Passed mut.linkExport("]<sup>1</sup>") {"form1"} {"form1"}
Passed mut.linkExport("], vard. ]") {"form1", "form2"} {"form1", "form2"}
Passed mut.linkExport("(])") {"(form1)"} {"(form1)"}
Passed mut.linkExport("]") {"fōrm1"} {"fōrm1"}
Passed mut.linkExport("]") {"EU:s"} {"EU:s"}
Passed mut.linkExport("<nowiki/>form1, form2")
Med nowiki i modul
{"form2"} {"form2"}
Passed mut.linkExport("<nowiki/>form1, form2")
Med nowiki i mall
{"form2"} {"form2"}
Text Expected Actual
test04a_do_not_link:
Passed mut.link("ord1 ord2", "infl") ord1 ord2 ord1 ord2
Passed mut.link("noform", "no-link") noform noform
Text Expected Actual
test04b_do_not_link_export:
Passed mut.linkExport("ord1 ord2", "infl") {"ord1 ord2"} {"ord1 ord2"}
Passed mut.linkExport("noform", "no-link") {} {}
Text Expected Actual
test05a_link_but_no_tag:
Passed mut.link("noform1", "link-only") [] []
Passed mut.link("noform1, noform2", "link-only") [], [] [], []
Passed mut.link("], noform2", "link-only") [], [] [], []
Text Expected Actual
test05b_link_but_no_tag_export:
Passed mut.linkExport("noform1", "link-only") {} {}
Passed mut.linkExport("noform1, noform2", "link-only") {} {}
Passed mut.linkExport("], noform2", "link-only") {} {}
Text Expected Actual
test06a_special_cases:
Passed mut.link("", "infl") &nbsp; &nbsp;
Passed mut.link("", "no-link") &nbsp; &nbsp;
Passed mut.link("", "link-only") &nbsp; &nbsp;
Passed mut.link("-", "infl")
Passed mut.link("-", "no-link")
Passed mut.link("-", "link-only")
Passed mut.link("?", "infl") ? ?
Passed mut.link("?", "no-link") ? ?
Passed mut.link("?", "link-only") ? ?
Text Expected Actual
test06b_special_cases_export:
Passed mut.linkExport("", "infl") {} {}
Passed mut.linkExport("", "no-link") {} {}
Passed mut.linkExport("", "link-only") {} {}
Passed mut.linkExport("-", "infl") {} {}
Passed mut.linkExport("-", "no-link") {} {}
Passed mut.linkExport("-", "link-only") {} {}
Passed mut.linkExport("?", "infl") {} {}
Passed mut.linkExport("?", "no-link") {} {}
Passed mut.linkExport("?", "link-only") {} {}
Text Expected Actual
test_07a_maybe_slightly:
Passed mut.link("(form1)", "infl") '''('''<span data-grammar-link="infl">[]</span>''')''' '''('''<span data-grammar-link="infl">[]</span>''')'''
Passed mut.link("form1?", "infl") '''('''form1''')?''' '''('''form1''')?'''
Passed mut.link(" form1? ", "infl") '''('''form1''')?''' '''('''form1''')?'''
Passed mut.link("(form1), form2", "infl") '''('''<span data-grammar-link="infl">[]</span>''')''', <span data-grammar-link="infl">[]</span> '''('''<span data-grammar-link="infl">[]</span>''')''', <span data-grammar-link="infl">[]</span>
Passed mut.link("form1?, form2", "infl") '''('''form1''')?''', <span data-grammar-link="infl">[]</span> '''('''form1''')?''', <span data-grammar-link="infl">[]</span>
Passed mut.link("(form1), ]", "infl") '''('''<span data-grammar-link="infl">[]</span>''')''', <span data-grammar-link="infl">[]</span> '''('''<span data-grammar-link="infl">[]</span>''')''', <span data-grammar-link="infl">[]</span>
Passed mut.link("form1?, ]", "infl") '''('''form1''')?''', <span data-grammar-link="infl">[]</span> '''('''form1''')?''', <span data-grammar-link="infl">[]</span>
Text Expected Actual
test_07b_maybe_slightly_export:
Passed mut.linkExport("(form1)", "infl") {"(form1)"} {"(form1)"}
Passed mut.linkExport("form1?", "infl") {"form1?"} {"form1?"}
Passed mut.linkExport(" form1? ", "infl") {"form1?"} {"form1?"}
Passed mut.linkExport("(form1), form2", "infl") {"(form1)", "form2"} {"(form1)", "form2"}
Passed mut.linkExport("form1?, form2", "infl") {"form1?", "form2"} {"form1?", "form2"}
Passed mut.linkExport("(form1), ]", "infl") {"(form1)", "form2"} {"(form1)", "form2"}
Passed mut.linkExport("form1?, ]", "infl") {"form1?", "form2"} {"form1?", "form2"}
Text Expected Actual
test_08_do_not_add_anchor_if_pagename_equals_inflection:
Passed mut.link("grammar-link/test", "infl", "en", "verb") <span class="grammar-inline" data-lang="en" data-h3="verb"><span data-grammar-link="infl">[[grammar-link/test]]</span></span> <span class="grammar-inline" data-lang="en" data-h3="verb"><span data-grammar-link="infl">[[grammar-link/test]]</span></span>
Passed mut.link("]", "infl", "en", "verb") <span class="grammar-inline" data-lang="en" data-h3="verb"><span data-grammar-link="infl">[[grammar-link/test]]</span></span> <span class="grammar-inline" data-lang="en" data-h3="verb"><span data-grammar-link="infl">[[grammar-link/test]]</span></span>
Passed mut.link("], ]", "infl", "en", "verb") <span class="grammar-inline" data-lang="en" data-h3="verb"><span data-grammar-link="infl">[[grammar-link/test]]</span></span> <span class="grammar-inline" data-lang="en" data-h3="verb"><span data-grammar-link="infl">[[grammar-link/test]]</span></span>
local t = require("Modul:UnitTests")
local lk = require("Modul:link")
local mut = require("Modul:grammar-link")

local nowiki = function(s)
	return s:gsub('', { = "\n !",  = "\r !"})
end

function t:test01a_basic()
	self:equals('mut.link("form1", "infl")', mut.link("form1", "infl"), '<span data-grammar-link="infl">' .. lk.link("form1") .. '</span>', {nowiki=1})
	self:equals('mut.link(" form1 ", "infl")', mut.link(" form1 ", "infl"), '<span data-grammar-link="infl">' .. lk.link("form1") .. '</span>', {nowiki=1})
	self:equals('mut.link("form1", "infl", "sv")', mut.link("form1", "infl", "sv"), '<span data-grammar-link="infl">' .. lk.link("form1", "sv") .. '</span>', {nowiki=1})
	self:equals('mut.link("form1", "infl", "sv", "verb)', mut.link("form1", "infl", "sv", "verb"), '<span class="grammar-inline" data-lang="sv" data-h3="verb"><span data-grammar-link="infl">' .. lk.link("form1", "sv") .. '</span></span>', {nowiki=1})
	self:equals('mut.link("form1", "adv")', mut.link("form1", "adv"), '<span data-grammar-link="adv">' .. lk.link("form1") .. '</span>', {nowiki=1})
	self:equals('mut.link("form1", "adv", "de")', mut.link("form1", "adv", "de"), '<span data-grammar-link="adv">' .. lk.link("form1", "de") .. '</span>', {nowiki=1})
	self:equals('mut.link("form1", "adv", "de", "verb)', mut.link("form1", "adv", "de", "verb"), '<span class="grammar-inline" data-lang="de" data-h3="verb"><span data-grammar-link="adv">' .. lk.link("form1", "de") .. '</span></span>', {nowiki=1})
	self:equals('mut.link("form1", "perfpart")', mut.link("form1", "perfpart"), '<span data-grammar-link="perfpart">' .. lk.link("form1") .. '</span>', {nowiki=1})
	self:equals('mut.link("form1", "perfpart", "en")', mut.link("form1", "perfpart", "en"), '<span data-grammar-link="perfpart">' .. lk.link("form1", "en") .. '</span>', {nowiki=1})
	self:equals('mut.link("form1", "perfpart", "en", "verb)', mut.link("form1", "perfpart", "en", "verb"), '<span class="grammar-inline" data-lang="en" data-h3="verb"><span data-grammar-link="perfpart">' .. lk.link("form1", "en") .. '</span></span>', {nowiki=1})
end

function t:test01b_basic_export()
	self:equals_deep('mut.linkExport("form1", "infl")', mut.linkExport("form1", "infl"), {"form1"}, {nowiki=1})
	self:equals_deep('mut.linkExport("form1", "adv")', mut.linkExport("form1", "adv"), {"form1"}, {nowiki=1})
	self:equals_deep('mut.linkExport("form1", "perfpart")', mut.linkExport("form1", "perfpart"), {"form1"}, {nowiki=1})
	self:equals_deep('mut.linkExport(" form1 ", "infl")', mut.linkExport(" form1 ", "infl"), {"form1"}, {nowiki=1})
end

function t:test02a_multiple()
	self:equals('mut.link("form1, form2", "infl")', mut.link("form1, form2", "infl"), '<span data-grammar-link="infl">' .. lk.link("form1") .. '</span>, <span data-grammar-link="infl">' .. lk.link("form2") .. '</span>', {nowiki=1})
	self:equals('mut.link("form1, form2", "infl", "sv")', mut.link("form1, form2", "infl", "sv"), '<span data-grammar-link="infl">' .. lk.link("form1", "sv") .. '</span>, <span data-grammar-link="infl">' .. lk.link("form2", "sv") .. '</span>', {nowiki=1})
	self:equals('mut.link("form1, form2", "infl", "sv", "verb)', mut.link("form1, form2", "infl", "sv", "verb"), '<span class="grammar-inline" data-lang="sv" data-h3="verb"><span data-grammar-link="infl">' .. lk.link("form1", "sv") .. '</span>, <span data-grammar-link="infl">' .. lk.link("form2", "sv") .. '</span></span>', {nowiki=1})
	self:equals('<nowiki>mut.link("], ]", "infl"</nowiki>)', mut.link("], ]", "infl"), '<span data-grammar-link="infl">' .. lk.link("]") .. '</span>, <span data-grammar-link="infl">' .. lk.link("]") .. '</span>', {nowiki=1})
	self:equals('<nowiki>mut.link("], ]", "infl", "sv"</nowiki>)', mut.link("], ]", "infl", "sv"), '<span data-grammar-link="infl">' .. lk.link("]", "sv") .. '</span>, <span data-grammar-link="infl">' .. lk.link("]", "sv") .. '</span>', {nowiki=1})
	self:equals('<nowiki>mut.link("], ]", "infl", "sv", "verb"</nowiki>)', mut.link("], ]", "infl", "sv", "verb"), '<span class="grammar-inline" data-lang="sv" data-h3="verb"><span data-grammar-link="infl">' .. lk.link("]", "sv") .. '</span>, <span data-grammar-link="infl">' .. lk.link("]", "sv") .. '</span></span>', {nowiki=1})
	self:equals('<nowiki>mut.link("], form2", "infl"</nowiki>)', mut.link("], form2", "infl"), '<span data-grammar-link="infl">' .. lk.link("]") .. '</span>, <span data-grammar-link="infl">' .. lk.link("form2") .. '</span>', {nowiki=1})
	self:equals('<nowiki>mut.link("], form2", "infl", "sv"</nowiki>)', mut.link("], form2", "infl", "sv"), '<span data-grammar-link="infl">' .. lk.link("]", "sv") .. '</span>, <span data-grammar-link="infl">' .. lk.link("form2", "sv") .. '</span>', {nowiki=1})
	self:equals('<nowiki>mut.link("], form2", "infl", "sv", "verb"</nowiki>)', mut.link("], form2", "infl", "sv", "verb"), '<span class="grammar-inline" data-lang="sv" data-h3="verb"><span data-grammar-link="infl">' .. lk.link("]", "sv") .. '</span>, <span data-grammar-link="infl">' .. lk.link("form2", "sv") .. '</span></span>', {nowiki=1})
	self:equals('<nowiki>mut.link("form1, ]", "infl"</nowiki>)', mut.link("form1, ]", "infl"), '<span data-grammar-link="infl">' .. lk.link("form1") .. '</span>, <span data-grammar-link="infl">' .. lk.link("]") .. '</span>', {nowiki=1})
	self:equals('<nowiki>mut.link("form1, ]", "infl", "sv"</nowiki>)', mut.link("form1, ]", "infl", "sv"), '<span data-grammar-link="infl">' .. lk.link("form1", "sv") .. '</span>, <span data-grammar-link="infl">' .. lk.link("]", "sv") .. '</span>', {nowiki=1})
	self:equals('<nowiki>mut.link("form1, ]", "infl", "sv", "verb"</nowiki>)', mut.link("form1, ]", "infl", "sv", "verb"), '<span class="grammar-inline" data-lang="sv" data-h3="verb"><span data-grammar-link="infl">' .. lk.link("form1", "sv") .. '</span>, <span data-grammar-link="infl">' .. lk.link("]", "sv") .. '</span></span>', {nowiki=1})
end

function t:test02b_multiple_export()
	self:equals_deep('mut.linkExport("form1, form2", "infl")', mut.linkExport("form1, form2", "infl"), {"form1", "form2"}, {nowiki=1})
	self:equals_deep('<nowiki>mut.linkExport("], ]", "infl"</nowiki>)', mut.linkExport("], ]", "infl"), {"form1", "form2"}, {nowiki=1})
	self:equals_deep('<nowiki>mut.linkExport("], form2", "infl"</nowiki>)', mut.linkExport("], form2", "infl"), {"form1", "form2"}, {nowiki=1})
	self:equals_deep('<nowiki>mut.linkExport("form1, ]", "infl"</nowiki>)', mut.linkExport("form1, ]", "infl"), {"form1", "form2"}, {nowiki=1})
end

function t:test03a_misc()
	self:equals('<nowiki>mut.link("]<sup>1</sup>")</nowiki>', mut.link("]<sup>1</sup>", "infl"), '<span data-grammar-link="infl">' .. lk.link("]") .. '</span><sup>1</sup>', {nowiki=1})
	self:equals('<nowiki>mut.link("], vard. ]")</nowiki>', mut.link("], vard. ]", "infl"), '<span data-grammar-link="infl">' .. lk.link("]") .. '</span>, vard. <span data-grammar-link="infl">' .. lk.link("]") .. '</span>', {nowiki=1})
	self:equals('<nowiki>mut.link("(])")</nowiki>', mut.link("(])", "infl"), =] .. lk.link("]") .. =], {nowiki=1})
	self:equals('<nowiki>mut.link("]")</nowiki>', mut.link("]", "infl"), '<span data-grammar-link="infl">' .. lk.link("]") .. '</span>', {nowiki=1})
	self:equals('<nowiki>mut.link("]")</nowiki>', mut.link("]", "infl"), '<span data-grammar-link="infl">' .. lk.link("]") .. '</span>', {nowiki=1})
	--self:equals('<nowiki>mut.link("]<ref>]</ref>")</nowiki>', mut.link("]<ref>]</ref>", "infl"), '<span data-grammar-link="infl">' .. lk.link("]") .. '</span><ref>]</ref>', {nowiki=1}) -- inaktiverad tills vi vet hur vi vill ha det
	self:equals(], mut.link("<nowiki/>form1, form2", "infl"), '<nowiki/>form1, <span data-grammar-link="infl">' .. lk.link("]") .. '</span>', {nowiki=1})
	local uniq_nowiki = "\127\"`UNIQ--nowiki-00000001-QINU`\"'\127"
	self:equals(], mut.link(uniq_nowiki .. "form1, form2", "infl"), uniq_nowiki .. 'form1, <span data-grammar-link="infl">' .. lk.link("]") .. '</span>', {nowiki=1})
end

function t:test03b_misc_export()
	self:equals_deep('<nowiki>mut.linkExport("]<sup>1</sup>")</nowiki>', mut.linkExport("]<sup>1</sup>", "infl"), {"form1"}, {nowiki=1})
	self:equals_deep('<nowiki>mut.linkExport("], vard. ]")</nowiki>', mut.linkExport("], vard. ]", "infl"), {"form1", "form2"}, {nowiki=1})
	self:equals_deep('<nowiki>mut.linkExport("(])")</nowiki>', mut.linkExport("(])", "infl"), {"(form1)"}, {nowiki=1})
	self:equals_deep('<nowiki>mut.linkExport("]")</nowiki>', mut.linkExport("]", "infl"), {"fōrm1"}, {nowiki=1})
	self:equals_deep('<nowiki>mut.linkExport("]")</nowiki>', mut.linkExport("]", "infl"), {"EU:s"}, {nowiki=1})
	self:equals_deep(], mut.linkExport("<nowiki/>form1, form2", "infl"), {"form2"}, {nowiki=1})
	local uniq_nowiki = "\127\"`UNIQ--nowiki-00000001-QINU`\"'\127"
	self:equals_deep(], mut.linkExport(uniq_nowiki .. "form1, form2", "infl"), {"form2"}, {nowiki=1})
end

function t:test04a_do_not_link()
	self:equals('mut.link("ord1 ord2", "infl")', mut.link("ord1 ord2", "infl"), "ord1 ord2", {nowiki=1})
	self:equals('mut.link("noform", "no-link")', mut.link("noform", "no-link"), "noform", {nowiki=1})
end

function t:test04b_do_not_link_export()
	self:equals_deep('mut.linkExport("ord1 ord2", "infl")', mut.linkExport("ord1 ord2", "infl"), {"ord1 ord2"}, {nowiki=1})
	self:equals_deep('mut.linkExport("noform", "no-link")', mut.linkExport("noform", "no-link"), {}, {nowiki=1})
end

function t:test05a_link_but_no_tag()
	self:equals('<nowiki>mut.link("noform1", "link-only")</nowiki>', mut.link("noform1", "link-only"), lk.link("noform1"), {nowiki=1})
	self:equals('<nowiki>mut.link("noform1, noform2", "link-only")</nowiki>', mut.link("noform1, noform2", "link-only"), lk.link("noform1, noform2"), {nowiki=1})
	self:equals('<nowiki>mut.link("], noform2", "link-only")</nowiki>', mut.link("], noform2", "link-only"), lk.link("], noform2"), {nowiki=1})
end

function t:test05b_link_but_no_tag_export()
	self:equals_deep('<nowiki>mut.linkExport("noform1", "link-only")</nowiki>', mut.linkExport("noform1", "link-only"), {}, {nowiki=1})
	self:equals_deep('<nowiki>mut.linkExport("noform1, noform2", "link-only")</nowiki>', mut.linkExport("noform1, noform2", "link-only"), {}, {nowiki=1})
	self:equals_deep('<nowiki>mut.linkExport("], noform2", "link-only")</nowiki>', mut.linkExport("], noform2", "link-only"), {}, {nowiki=1})
end

function t:test06a_special_cases()
	self:equals('mut.link("", "infl")', mut.link("", "infl"), "&nbsp;", {nowiki=1})
	self:equals('mut.link("", "no-link")', mut.link("", "no-link"), "&nbsp;", {nowiki=1})
	self:equals('mut.link("", "link-only")', mut.link("", "link-only"), "&nbsp;", {nowiki=1})
	self:equals('mut.link("-", "infl")', mut.link("-", "infl"), "–", {nowiki=1})
	self:equals('mut.link("-", "no-link")', mut.link("-", "no-link"), "–", {nowiki=1})
	self:equals('mut.link("-", "link-only")', mut.link("-", "link-only"), "–", {nowiki=1})
	self:equals('mut.link("?", "infl")', mut.link("?", "infl"), "?", {nowiki=1})
	self:equals('mut.link("?", "no-link")', mut.link("?", "no-link"), "?", {nowiki=1})
	self:equals('mut.link("?", "link-only")', mut.link("?", "link-only"), "?", {nowiki=1})
end

function t:test06b_special_cases_export()
	self:equals_deep('mut.linkExport("", "infl")', mut.linkExport("", "infl"), {}, {nowiki=1})
	self:equals_deep('mut.linkExport("", "no-link")', mut.linkExport("", "no-link"), {}, {nowiki=1})
	self:equals_deep('mut.linkExport("", "link-only")', mut.linkExport("", "link-only"), {}, {nowiki=1})
	self:equals_deep('mut.linkExport("-", "infl")', mut.linkExport("-", "infl"), {}, {nowiki=1})
	self:equals_deep('mut.linkExport("-", "no-link")', mut.linkExport("-", "no-link"), {}, {nowiki=1})
	self:equals_deep('mut.linkExport("-", "link-only")', mut.linkExport("-", "link-only"), {}, {nowiki=1})
	self:equals_deep('mut.linkExport("?", "infl")', mut.linkExport("?", "infl"), {}, {nowiki=1})
	self:equals_deep('mut.linkExport("?", "no-link")', mut.linkExport("?", "no-link"), {}, {nowiki=1})
	self:equals_deep('mut.linkExport("?", "link-only")', mut.linkExport("?", "link-only"), {}, {nowiki=1})
end

function t:test_07a_maybe_slightly()
	self:equals('mut.link("(form1)", "infl")', mut.link("(form1)", "infl"), "'''('''" .. mut.link("form1", "infl") .. "''')'''", {nowiki=1})
	self:equals('mut.link("form1?", "infl")', mut.link("form1?", "infl"), "'''('''form1''')?'''", {nowiki=1})
	self:equals('mut.link(" form1? ", "infl")', mut.link(" form1? ", "infl"), "'''('''form1''')?'''", {nowiki=1})
	self:equals('mut.link("(form1), form2", "infl")', mut.link("(form1), form2", "infl"), "'''('''" .. mut.link("form1", "infl") .. "''')''', " .. mut.link("form2", "infl"), {nowiki=1})
	self:equals('mut.link("form1?, form2", "infl")', mut.link("form1?, form2", "infl"), "'''('''form1''')?''', " .. mut.link("form2", "infl"), {nowiki=1})
	self:equals('<nowiki>mut.link("(form1), ]", "infl")</nowiki>', mut.link("(form1), ]", "infl"), "'''('''" .. mut.link("form1", "infl") .. "''')''', " .. mut.link("form2", "infl"), {nowiki=1})
	self:equals('<nowiki>mut.link("form1?, ]", "infl")</nowiki>', mut.link("form1?, ]", "infl"), "'''('''form1''')?''', " .. mut.link("form2", "infl"), {nowiki=1})
end

function t:test_07b_maybe_slightly_export()
	self:equals_deep('mut.linkExport("(form1)", "infl")', mut.linkExport("(form1)", "infl"), {"(form1)"}, {nowiki=1})
	self:equals_deep('mut.linkExport("form1?", "infl")', mut.linkExport("form1?", "infl"), {"form1?"}, {nowiki=1})
	self:equals_deep('mut.linkExport(" form1? ", "infl")', mut.linkExport(" form1? ", "infl"), {"form1?"}, {nowiki=1})
	self:equals_deep('mut.linkExport("(form1), form2", "infl")', mut.linkExport("(form1), form2", "infl"), {"(form1)", "form2"}, {nowiki=1})
	self:equals_deep('mut.linkExport("form1?, form2", "infl")', mut.linkExport("form1?, form2", "infl"), {"form1?", "form2"}, {nowiki=1})
	self:equals_deep('<nowiki>mut.linkExport("(form1), ]", "infl")</nowiki>', mut.linkExport("(form1), ]", "infl"), {"(form1)", "form2"}, {nowiki=1})
	self:equals_deep('<nowiki>mut.linkExport("form1?, ]", "infl")</nowiki>', mut.linkExport("form1?, ]", "infl"), {"form1?", "form2"}, {nowiki=1})
end

function t:test_08_do_not_add_anchor_if_pagename_equals_inflection()
	self:equals('mut.link("<nowiki>' .. mw.title.getCurrentTitle().text .. '", "infl", "en", "verb</nowiki>")', mut.link(mw.title.getCurrentTitle().text, "infl", "en", "verb"), '<span class="grammar-inline" data-lang="en" data-h3="verb"><span data-grammar-link="infl">]</span></span>', {nowiki=1})
	self:equals('mut.link("<nowiki>]", "infl", "en", "verb</nowiki>")', mut.link(mw.title.getCurrentTitle().text, "infl", "en", "verb"), '<span class="grammar-inline" data-lang="en" data-h3="verb"><span data-grammar-link="infl">]</span></span>', {nowiki=1})
	self:equals('mut.link("<nowiki>], ]", "infl", "en", "verb</nowiki>")', mut.link(mw.title.getCurrentTitle().text, "infl", "en", "verb"), '<span class="grammar-inline" data-lang="en" data-h3="verb"><span data-grammar-link="infl">]</span></span>', {nowiki=1})
end

return t