Module:ConvertNumeric/sandbox/testcases explained

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

local frame = mw.getCurrentFramelocal function get_error_text(wikitext) local message = frame:preprocess(wikitext):match('<[^>]+>(.-)<[^>]+>') message = message:match('at line %d+: (.+)%.$') or message return messageend

function p:test_numeral_to_english self:preprocess_equals_many('',)end

function p:test_numeral_to_english_error local cases = local nowiki = mw.text.nowiki for _, case in ipairs(cases) do local wikitext = '' self:equals(nowiki(wikitext), get_error_text(wikitext), 'Invalid decimal numeral') endend

function p:test_numeral_to_english_round self:preprocess_equals_many('',)end

function p:test_decToHex self:preprocess_equals('', '000A 0014 0028 0400 4B41B59' )end

return p