Content deleted Content added
the error in the results table wikicode was in the row with success, not in the header |
sync from main module |
||
Line 1:
-------------------------------------------------------------------------------
-- Unit tests for Scribunto.
Line 107 ⟶ 105:
function ScribuntoUnit:assertTrue(actual, message)
if not actual then
DebugHelper.raise({ScribuntoUnit = true, text = string.format("Failed to assert that %s is true", tostring(actual)), message = message}, 2)
message = message▼
}, 2)▼
end
end
Line 120 ⟶ 115:
function ScribuntoUnit:assertFalse(actual, message)
if actual then
DebugHelper.raise({ScribuntoUnit = true, text = string.format("Failed to assert that %s is false", tostring(actual)), message = message}, 2)
message = message▼
}, 2)▼
end
end
Line 133 ⟶ 125:
--
function ScribuntoUnit:assertStringContains(pattern, s, plain, message)
end
Line 167 ⟶ 159:
function ScribuntoUnit:assertEquals(expected, actual, message)
self:assertWithinDelta(expected, actual, 1e-8, message)
DebugHelper.raise({
ScribuntoUnit = true,
text = string.format(
actual = actual,
expected = expected,
Line 226 ⟶ 218:
DebugHelper.raise({
ScribuntoUnit = true,
text = string.format("Failed to assert that %s equals expected %s", tostring(actual), tostring(expected)),
actual = actual,
expected = expected,
Line 265 ⟶ 255:
if processed1 ~= processed2 then
DebugHelper.raise({
ScribuntoUnit = true,
text = string.format("Failed to assert that %s equals expected %s after preprocessing", processed1, processed2),
expected = processed2,
expectedRaw = text2,
message = message,
}, 2)
Line 420 ⟶ 414:
local successIcon, failIcon = self.frame:preprocess('{{tick}}'), self.frame:preprocess('{{cross}}')
local text = '{| class="wikitable scribunto-test-table"\n'
text = text .. '! !!
for _, result in ipairs(testData.results) do
text = text .. '|-\n'
if result.error then
text = text .. '| ' .. failIcon .. ' || ' .. result.name .. ' || '
text = text .. tostring(result.expected) .. ' || ' .. tostring(result.actual) .. '\n'
text = text .. ' colspan="2" | ' .. result.message .. '\n'
else
text = text .. '| ' .. successIcon .. ' || ' .. result.name .. ' || ||\n'
end
end
|