Module:Factorization/testcases
Appearance
| This is the test cases page for the module Module:Factorization. Results of the test cases. |
-- Unit tests for [[Module:Factorization]]. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test_factor()
self:preprocess_equals_sandbox_many('{{#invoke:Factorization', 'factor', {
{'-20', '<strong class="error">Error: -20 out of range</strong>'},
{'0', '<strong class="error">Error: 0 out of range</strong>'},
{'1', '<strong class="error">Error: 1 out of range</strong>'},
{'2', '2'},
{'5', '5'},
{'10', '2 · 5'},
{'25', '5<sup>2</sup>'},
{'40', '2<sup>3</sup> · 5'},
{'111', '3 · 37'},
{'999999999', '3<sup>4</sup> · 37 · 333667'},
{'1000000001', '7 · 11 · 13 · 19 · 52579'},
{'9007199254740992', '<strong class="error">Error: 9.007199254741e+15 out of range</strong>'},
{'4.5', '2<sup>2</sup>'},
{'-9.9', '<strong class="error">Error: -10 out of range</strong>'},
{'20', '2<sup>2</sup> · 5'},
{'20|big=y', '<span style="font-size:165%">2<sup>2</sup> · 5 </span>'},
{'20|serif=yes|bold=true', '<span class="texhtml"><b>2<sup>2</sup> · 5 </b></span>'},
}, {nowiki=1})
end
return p