Module:qualifier/testcases
Appearance
- The following documentation is located at Module:qualifier/testcases/documentation. [edit] Categories were auto-generated by Module:documentation. [edit]
- Useful links: root page • root page’s subpages • links • 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