Module:qualifier/testcases
Appearance
- පහත දැක්වෙන උපදෙස්, Module:qualifier/testcases/documentation හි පිහිටා ඇත. Module:qualifier/testcases/documentation]]. [සංස්කරණය] Categories were auto-generated by Module:documentation. [edit]
- ප්රයෝජනවත් සබැඳි: root page • root page’s subpages • සබැඳි • transclusions • tested module • sandbox
2 tests failed.
Name | Expected | Actual | |
---|---|---|---|
test_format_qualifier_multiple_arguments | |||
test_format_qualifier_no_arguments | |||
test_format_qualifier_single_argument | |||
test_qualifier_t | Lua error -- Module:qualifier/testcases:22: attempt to call field 'qualifier_t' (a nil value) | ||
test_sense_t | Lua error -- Module:qualifier/testcases:29: attempt to call field 'sense_t' (a nil value) |
local ScribuntoUnit = require('Module:ScribuntoUnit')
local suite = ScribuntoUnit:new()
local m_qualifier = require('Module:qualifier')
function suite:test_format_qualifier_no_arguments()
local result = m_qualifier.format_qualifier({})
suite:assertEquals('', result)
end
function suite:test_format_qualifier_single_argument()
local result = m_qualifier.format_qualifier({'foo'})
suite:assertEquals('<span class="ib-brac qualifier-brac">(</span><span class="ib-content qualifier-content">foo</span><span class="ib-brac qualifier-brac">)</span>', result)
end
function suite:test_format_qualifier_multiple_arguments()
local result = m_qualifier.format_qualifier({'foo', 'bar'})
suite:assertEquals('<span class="ib-brac qualifier-brac">(</span><span class="ib-content qualifier-content">foo<span class="ib-comma qualifier-comma">,</span> bar</span><span class="ib-brac qualifier-brac">)</span>', result)
end
function suite:test_qualifier_t()
local frame = mw.getCurrentFrame():newChild({ title = 'test', args = { 'foo' } }):newChild{}
local result = m_qualifier.qualifier_t(frame)
suite:assertEquals('<span class="ib-brac qualifier-brac">(</span><span class="ib-content qualifier-content">foo</span><span class="ib-brac qualifier-brac">)</span>', result)
end
function suite:test_sense_t()
local frame = mw.getCurrentFrame():newChild({ title = 'test', args = { 'foo' } }):newChild{}
local result = m_qualifier.sense_t(frame)
suite:assertEquals('<span class="ib-brac qualifier-brac">(</span><span class="ib-content qualifier-content">foo</span><span class="ib-brac qualifier-brac">)</span><span class="ib-colon sense-qualifier-colon">:</span>', result)
end
return suite