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('', '- 2&#x3c;sup&#x3e;2&#x3c;/sup&#x3e;· 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('', '5&#x3c;sup&#x3e;2&#x3c;/sup&#x3e;') self:preprocess_equals('', '2&#x3c;sup&#x3e;3&#x3c;/sup&#x3e;· 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('', '2&#x3c;sup&#x3e;2&#x3c;/sup&#x3e;* 5') self:preprocess_equals('', '&#x3c;span style="font-size:165%"&#x3e;2&#x3c;sup&#x3e;2&#x3c;/sup&#x3e;· 5&#x3c;/span&#x3e;') self:preprocess_equals('', '&#x3c;span class="texhtml"&#x3e;&#x3c;b&#x3e;2&#x3c;sup&#x3e;2&#x3c;/sup&#x3e;· 5&#x3c;/b&#x3e;&#x3c;/span&#x3e;') end

function p:test_factorSandbox self:preprocess_equals('', '- 2&#x3c;sup&#x3e;2&#x3c;/sup&#x3e;· 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('', '5&#x3c;sup&#x3e;2&#x3c;/sup&#x3e;') self:preprocess_equals('', '2&#x3c;sup&#x3e;3&#x3c;/sup&#x3e;· 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('', '2&#x3c;sup&#x3e;2&#x3c;/sup&#x3e;* 5') self:preprocess_equals('', '&#x3c;span style="font-size:165%"&#x3e;2&#x3c;sup&#x3e;2&#x3c;/sup&#x3e;· 5&#x3c;/span&#x3e;') self:preprocess_equals('', '&#x3c;span class="texhtml"&#x3e;&#x3c;b&#x3e;2&#x3c;sup&#x3e;2&#x3c;/sup&#x3e;· 5&#x3c;/b&#x3e;&#x3c;/span&#x3e;') end

return p