Module:Factorization/testcases

-- Unit tests for Module:Factorization. Click talk page to run tests. local p = require('Module:UnitTests')

function p:test_factor self:preprocess_equals('', '- 22· 5') self:preprocess_equals('', '- 2 · 5') self:preprocess_equals('', '-3') self:preprocess_equals('', '-1') self:preprocess_equals('', '0') self:preprocess_equals('', '1') self:preprocess_equals('', '2') self:preprocess_equals('', '5') self:preprocess_equals('', '2 · 5') self:preprocess_equals('', '52') self:preprocess_equals('', '23· 5') self:preprocess_equals('', '3 · 37') self:preprocess_equals('', '7· 11· 13· 19· 52579') -- max 1,000,000,--- self:preprocess_equals('', '2 · 2') self:preprocess_equals('', '-2 · 5') self:preprocess_equals('', '22* 5') self:preprocess_equals('', ' 22· 5 ') self:preprocess_equals('', ' 22· 5 ') end

function p:test_factorSandbox self:preprocess_equals('', '- 22· 5') self:preprocess_equals('', '- 2 · 5') self:preprocess_equals('', '-3') self:preprocess_equals('', '-1') self:preprocess_equals('', '0') self:preprocess_equals('', '1') self:preprocess_equals('', '2') self:preprocess_equals('', '5') self:preprocess_equals('', '2 · 5') self:preprocess_equals('', '52') self:preprocess_equals('', '23· 5') self:preprocess_equals('', '3 · 37') self:preprocess_equals('', '7· 11· 13· 19· 52579') -- max 1,000,000,--- self:preprocess_equals('', '2 · 2') self:preprocess_equals('', '-2 · 5') self:preprocess_equals('', '22* 5') self:preprocess_equals('', ' 22· 5 ') self:preprocess_equals('', ' 22· 5 ') end

return p