Module:Factorization/testcases: Difference between revisions
Appearance
Content deleted Content added
←Created page with '-- Example Unit tests for Module:Factorization. Click talk page to run tests. local p = require('Module:UnitTests') function p:test_factor() self:prepro...' |
No edit summary |
||
Line 6: | Line 6: | ||
self:preprocess_equals('{{#invoke:Factorization | factor | 2}}', '2') |
self:preprocess_equals('{{#invoke:Factorization | factor | 2}}', '2') |
||
self:preprocess_equals('{{#invoke:Factorization | factor | 5}}', '5') |
self:preprocess_equals('{{#invoke:Factorization | factor | 5}}', '5') |
||
self:preprocess_equals('{{#invoke:Factorization | factor | 10}}', '2 \cdot 5') |
self:preprocess_equals('{{#invoke:Factorization | factor | 10}}', '2 \\cdot 5') |
||
self:preprocess_equals('{{#invoke:Factorization | factor | 25}}', '5^2') |
self:preprocess_equals('{{#invoke:Factorization | factor | 25}}', '5^2') |
||
self:preprocess_equals('{{#invoke:Factorization | factor | 40}}', '2^3 \cdot 5') |
self:preprocess_equals('{{#invoke:Factorization | factor | 40}}', '2^3 \\cdot 5') |
||
self:preprocess_equals('{{#invoke:Factorization | factor | 111}}', '3 \cdot 37') |
self:preprocess_equals('{{#invoke:Factorization | factor | 111}}', '3 \\cdot 37') |
||
self:preprocess_equals('{{#invoke:Factorization | factor | 1000001}}', '1000001') -- max 1,000,000 |
|||
end |
end |
||
Revision as of 01:21, 26 April 2013
![]() | This is the test cases page for the module Module:Factorization. Results of the test cases. |
-- Example Unit tests for [[Module:Factorization]]. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test_factor()
self:preprocess_equals('{{#invoke:Factorization | factor | 1}}', '1')
self:preprocess_equals('{{#invoke:Factorization | factor | 2}}', '2')
self:preprocess_equals('{{#invoke:Factorization | factor | 5}}', '5')
self:preprocess_equals('{{#invoke:Factorization | factor | 10}}', '2 \\cdot 5')
self:preprocess_equals('{{#invoke:Factorization | factor | 25}}', '5^2')
self:preprocess_equals('{{#invoke:Factorization | factor | 40}}', '2^3 \\cdot 5')
self:preprocess_equals('{{#invoke:Factorization | factor | 111}}', '3 \\cdot 37')
self:preprocess_equals('{{#invoke:Factorization | factor | 1000001}}', '1000001') -- max 1,000,000
end
return p