Module:Wordify/testcases

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

local function err(msg) -- Generates wikitext error messages. return mw.ustring.format(' Formatting error: %s ', msg) end

function p:test_wordify_India self:preprocess_equals('', '1') self:preprocess_equals('', '1.00 lakh') self:preprocess_equals('', 'lakh') self:preprocess_equals('', '10 lakh') self:preprocess_equals('', 'crore') self:preprocess_equals('', '100 crore') self:preprocess_equals('', 'lakh crore') self:preprocess_equals('', '1 lakh crore') self:preprocess_equals('', 'crore crore') self:preprocess_equals('', '1 crore crore') self:preprocess_equals('', '1') self:preprocess_equals('', 'lakh') self:preprocess_equals('', '1 lakh') self:preprocess_equals('', '10 lakh') self:preprocess_equals('', 'crore') self:preprocess_equals('', '100 crore') self:preprocess_equals('', 'lakh crore') self:preprocess_equals('', '1 lakh crore') self:preprocess_equals('', 'crore crore') self:preprocess_equals('', '1 crore crore') end

function p:test_wordify_default self:preprocess_equals('', '1') self:preprocess_equals('', '100,000.99') self:preprocess_equals('', '1.00 million') self:preprocess_equals('', 'million') self:preprocess_equals('', "million's") self:preprocess_equals('', 'millions') self:preprocess_equals('', "millions'") self:preprocess_equals('', '1 million') self:preprocess_equals('', '1 billion') self:preprocess_equals('', '1 trillion') self:preprocess_equals('', '1 duodecillion') self:preprocess_equals('', '1 tredecillion') self:preprocess_equals('', '1') self:preprocess_equals('', '100,000.99') self:preprocess_equals('', '1.00 million') self:preprocess_equals('', '1 million') self:preprocess_equals('', '1 billion') self:preprocess_equals('', '1 trillion') self:preprocess_equals('', '1 duodecillion') self:preprocess_equals('', '1 tredecillion') self:preprocess_equals('', '1 googol') self:preprocess_equals('', '1 centillion') self:preprocess_equals('', '1 billion') end

function p:test_wordify_USA self:preprocess_equals('', '1') self:preprocess_equals('', '100,000.99') self:preprocess_equals('', '1 million') self:preprocess_equals('', '1 billion') self:preprocess_equals('', '1 trillion') self:preprocess_equals('', '1') self:preprocess_equals('', '100,000.99') self:preprocess_equals('', '1.00 million') self:preprocess_equals('', '1 million') self:preprocess_equals('', '1 billion') self:preprocess_equals('', '1 trillion') self:preprocess_equals('', '1 duodecillion') self:preprocess_equals('', '1 tredecillion') self:preprocess_equals('', '1 googol') self:preprocess_equals('', '1 centillion') end

function p:test_wordify_Long self:preprocess_equals('', '1') self:preprocess_equals('', '100,000.99') self:preprocess_equals('', '1.00 million') self:preprocess_equals('', 'million') self:preprocess_equals('', '1 million') self:preprocess_equals('', '1 milliard') self:preprocess_equals('', '1 billion') self:preprocess_equals('', '1') self:preprocess_equals('', '100,000.99') self:preprocess_equals('', '1.00 million') self:preprocess_equals('', '1 million') self:preprocess_equals('', '1 milliard') self:preprocess_equals('', '1 billion') self:preprocess_equals('', '2 milliard') end

function p:test_wordify_French self:preprocess_equals('', '1 sextillion') self:preprocess_equals('', '1 sextilliard') self:preprocess_equals('', '1 septillion') self:preprocess_equals('', '2.00 million') self:preprocess_equals('', '100\194\160000,99') self:preprocess_equals('', '2 millions') self:preprocess_equals('', '2 milliards') self:preprocess_equals('', '2 billions') self:preprocess_equals('', '2.00 millions') self:preprocess_equals('', '2 millions') self:preprocess_equals('', '2 milliards') self:preprocess_equals('', '2 billions') end

function p:test_wordify_Portuguese self:preprocess_equals('', '1') self:preprocess_equals('', '100\194\160000,99') self:preprocess_equals('', '1 milhão') self:preprocess_equals('', 'mil milhões') self:preprocess_equals('', '1 bilião') self:preprocess_equals('', '1 milhão') self:preprocess_equals('', 'mil milhões') self:preprocess_equals('', '1 bilião') self:preprocess_equals('', 'mil sextiliões') self:preprocess_equals('', '1 septilião') self:preprocess_equals('', '2 milhões') self:preprocess_equals('', '2 mil milhões') self:preprocess_equals('', '2 biliões') self:preprocess_equals('', '2 milhões') self:preprocess_equals('', '2 mil milhões') self:preprocess_equals('', '2 biliões') end

function p:test_wordify_Aragonese self:preprocess_equals('', 'mil millons') self:preprocess_equals('', '2 mil millons') self:preprocess_equals('', '1 billón') self:preprocess_equals('', '2 billons') self:preprocess_equals('', 'mil billons') self:preprocess_equals('', '2 mil billons') self:preprocess_equals('', '1000 quatrillons') end

function p:test_wordify_Asturian self:preprocess_equals('', 'mil millones') self:preprocess_equals('', '2 mil millones') self:preprocess_equals('', '1 billón') self:preprocess_equals('', '2 billones') self:preprocess_equals('', 'mil billones') self:preprocess_equals('', '2 mil billones') self:preprocess_equals('', 'mil cuatrillones') self:preprocess_equals('', '1000 quintillones') end

function p:test_wordify_Spanish self:preprocess_equals('', '1 millardo') self:preprocess_equals('', '2 millardos') self:preprocess_equals('', '1 septillón') self:preprocess_equals('', '2 septillones') self:preprocess_equals('', 'mil septillones') self:preprocess_equals('', '2 mil septillones') end

function p:test_wordify_Galician self:preprocess_equals('', 'mil millóns') self:preprocess_equals('', '2 mil millóns') self:preprocess_equals('', '1 billón') self:preprocess_equals('', '2 billóns') self:preprocess_equals('', 'mil billóns') self:preprocess_equals('', '2 mil billóns') self:preprocess_equals('', '1.000 trillóns') end

function p:test_wordify_Interlingua self:preprocess_equals('', '1 milliardo') self:preprocess_equals('', '2 milliardos') self:preprocess_equals('', '1 billion') self:preprocess_equals('', '2 billiones') self:preprocess_equals('', 'mille billiones') self:preprocess_equals('', '2 mille billiones') self:preprocess_equals('', '1\194\160000 trilliones') end

function p:test_wordify_Finnish self:preprocess_equals('', '1 septiljoona') self:preprocess_equals('', '2 septiljoonaa') self:preprocess_equals('', 'septiljoonat') self:preprocess_equals('', 'tuhat septiljoonaa') self:preprocess_equals('', '2 tuhatta septiljoonaa') self:preprocess_equals('', 'tuhat septiljoonaa') end

function p:test_wordify_Hungarian self:preprocess_equals('', '1 szeptillió') self:preprocess_equals('', '2 szeptilliók') self:preprocess_equals('', '1 szeptilliárd') self:preprocess_equals('', '2 szeptilliárdok') self:preprocess_equals('', '1 szeptilliót') self:preprocess_equals('', '2 szeptilliókat') self:preprocess_equals('', '1 szeptillióé') self:preprocess_equals('', '2 szeptillióké') self:preprocess_equals('', '1 szeptilliárdé') self:preprocess_equals('', '2 szeptilliárdoké') self:preprocess_equals('', '1 szeptillióéi') self:preprocess_equals('', '2 szeptilliókéi') self:preprocess_equals('', '1 szeptilliárdéi') self:preprocess_equals('', '2 szeptilliárdokéi') self:preprocess_equals('', '1 szeptillióm') self:preprocess_equals('', '2 szeptillióim') self:preprocess_equals('', '1 szeptilliárdom') self:preprocess_equals('', '2 szeptilliárdaim') self:preprocess_equals('', '1 szeptilliód') self:preprocess_equals('', '2 szeptillióid') self:preprocess_equals('', '1 szeptilliárdod') self:preprocess_equals('', '2 szeptilliárdjaid') self:preprocess_equals('', '1 szeptilliója') self:preprocess_equals('', '2 szeptilliói') self:preprocess_equals('', '1 szeptilliárdja') self:preprocess_equals('', '2 szeptilliárdjai') self:preprocess_equals('', '1 szeptilliónk') self:preprocess_equals('', '2 szeptillióink') self:preprocess_equals('', '1 szeptilliárdunk') self:preprocess_equals('', '2 szeptilliárdjaink') self:preprocess_equals('', '1 szeptilliótok') self:preprocess_equals('', '2 szeptillióitok') self:preprocess_equals('', '1 szeptilliárdotok') self:preprocess_equals('', '2 szeptilliárdjaitok') self:preprocess_equals('', '1 szeptilliójuk') self:preprocess_equals('', '2 szeptillióik') self:preprocess_equals('', '1 szeptilliárdjuk') self:preprocess_equals('', '2 szeptilliárdjaik') end

function p:test_wordify_Italian self:preprocess_equals('', '1 quintilione') self:preprocess_equals('', '2 quintilioni') self:preprocess_equals('', '1 quintiliardo') self:preprocess_equals('', '2 quintiliardi') self:preprocess_equals('', '1\194\160000 quintiliardi') self:preprocess_equals('', '1\194\160000\194\160000 quintiliardi') self:preprocess_equals('', '1\194\160000\194\160000\194\160000 quintiliardi') end

function p:test_wordify_Sicilian self:preprocess_equals('', '1 quadriliuni') self:preprocess_equals('', '2 quadriliuni') self:preprocess_equals('', '1 quadriliardu') self:preprocess_equals('', '2 quadriliardi') self:preprocess_equals('', '1\194\160000 quadriliardi') self:preprocess_equals('', '1\194\160000\194\160000 quadriliardi') self:preprocess_equals('', '1\194\160000\194\160000\194\160000 quadriliardi') end

function p:test_wordify_Icelandic self:preprocess_equals('', '1 kvaðrilljarður') self:preprocess_equals('', '2 kvaðrilljarðar') self:preprocess_equals('', '1 kvintilljón') self:preprocess_equals('', '2 kvintilljónir') self:preprocess_equals('', '1.000 kvintilljónir') self:preprocess_equals('', '1.000.000 kvintilljónir') self:preprocess_equals('', '1.000.000.000 kvintilljónir') self:preprocess_equals('', '1.000.000.000.000 kvintilljónir') self:preprocess_equals('', '1 kvaðrilljarðurinn') self:preprocess_equals('', '2 kvaðrilljarðarnir') self:preprocess_equals('', '1 kvintilljónin') self:preprocess_equals('', '2 kvintilljónirnar') end

function p:test_wordify_Catalan self:preprocess_equals('', '1 septilió') self:preprocess_equals('', '2 septilions') self:preprocess_equals('', '3 septilions') self:preprocess_equals('', '4 septilions') self:preprocess_equals('', '5 septilions') self:preprocess_equals('', '6 septilions') self:preprocess_equals('', '7 septilions') self:preprocess_equals('', '6,5 septilions') self:preprocess_equals('', '1 septiliard') self:preprocess_equals('', '2 septiliards') self:preprocess_equals('', '3 septiliards') self:preprocess_equals('', '4 septiliards') self:preprocess_equals('', '5 septiliards') self:preprocess_equals('', '6 septiliards') self:preprocess_equals('', '7 septiliards') self:preprocess_equals('', '6,5 septiliards') end

function p:test_wordify_Danish self:preprocess_equals('', '1 septillion') self:preprocess_equals('', '2 septillioner') self:preprocess_equals('', '3 septillioner') self:preprocess_equals('', '4 septillioner') self:preprocess_equals('', '5 septillioner') self:preprocess_equals('', '6 septillioner') self:preprocess_equals('', '7 septillioner') self:preprocess_equals('', '6,5 septillioner') self:preprocess_equals('', '1 septilliard') self:preprocess_equals('', '2 septilliarder') self:preprocess_equals('', '3 septilliarder') self:preprocess_equals('', '4 septilliarder') self:preprocess_equals('', '5 septilliarder') self:preprocess_equals('', '6 septilliarder') self:preprocess_equals('', '7 septilliarder') self:preprocess_equals('', '6,5 septilliarder') self:preprocess_equals('', '1 septillionen') self:preprocess_equals('', '2 septillionerne') self:preprocess_equals('', '1 septilliarden') self:preprocess_equals('', '2 septilliarderne') end

function p:test_wordify_Polish self:preprocess_equals('', '1 septylion') self:preprocess_equals('', '2 septyliony') self:preprocess_equals('', '3 septyliony') self:preprocess_equals('', '4 septyliony') self:preprocess_equals('', '5 septylionów') self:preprocess_equals('', '10 septylionów') self:preprocess_equals('', '11 septylionów') self:preprocess_equals('', '12 septylionów') self:preprocess_equals('', '13 septylionów') self:preprocess_equals('', '14 septylionów') self:preprocess_equals('', '15 septylionów') self:preprocess_equals('', '20 septylionów') self:preprocess_equals('', '21 septylionów') self:preprocess_equals('', '22 septyliony') self:preprocess_equals('', '23 septyliony') self:preprocess_equals('', '24 septyliony') self:preprocess_equals('', '25 septylionów') self:preprocess_equals('', '7 septylionów') self:preprocess_equals('', '6,5 septyliona') self:preprocess_equals('', '1 septyliard') self:preprocess_equals('', '2 septyliardy') self:preprocess_equals('', '3 septyliardy') self:preprocess_equals('', '4 septyliardy') self:preprocess_equals('', '5 septyliardów') self:preprocess_equals('', '10 septyliardów') self:preprocess_equals('', '11 septyliardów') self:preprocess_equals('', '12 septyliardów') self:preprocess_equals('', '13 septyliardów') self:preprocess_equals('', '14 septyliardów') self:preprocess_equals('', '15 septyliardów') self:preprocess_equals('', '20 septyliardów') self:preprocess_equals('', '21 septyliardów') self:preprocess_equals('', '22 septyliardy') self:preprocess_equals('', '23 septyliardy') self:preprocess_equals('', '24 septyliardy') self:preprocess_equals('', '25 septyliardów') self:preprocess_equals('', '7 septyliardów') self:preprocess_equals('', '6,5 septyliarda') end

function p:test_wordify_Czech self:preprocess_equals('', '1 septilion') self:preprocess_equals('', '2 septiliony') self:preprocess_equals('', '3 septiliony') self:preprocess_equals('', '4 septiliony') self:preprocess_equals('', '5 septilionů') self:preprocess_equals('', '6 septilionů') self:preprocess_equals('', '7 septilionů') self:preprocess_equals('', '6,5 septilionu') self:preprocess_equals('', '1 septiliarda') self:preprocess_equals('', '2 septiliardy') self:preprocess_equals('', '3 septiliardy') self:preprocess_equals('', '4 septiliardy') self:preprocess_equals('', '5 septiliard') self:preprocess_equals('', '6 septiliard') self:preprocess_equals('', '7 septiliard') self:preprocess_equals('', '6,5 septiliardy') end

function p:test_wordify_Slovak self:preprocess_equals('', '1 septilión') self:preprocess_equals('', '2 septilióny') self:preprocess_equals('', '3 septilióny') self:preprocess_equals('', '4 septilióny') self:preprocess_equals('', '5 septiliónov') self:preprocess_equals('', '6 septiliónov') self:preprocess_equals('', '7 septiliónov') self:preprocess_equals('', '6,5 septilióna') self:preprocess_equals('', '1 septiliarda') self:preprocess_equals('', '2 septiliardy') self:preprocess_equals('', '3 septiliardy') self:preprocess_equals('', '4 septiliardy') self:preprocess_equals('', '5 septiliárd') self:preprocess_equals('', '6 septiliárd') self:preprocess_equals('', '7 septiliárd') self:preprocess_equals('', '6,5 septiliárd') end

function p:test_wordify_Slovene self:preprocess_equals('', '1 septilijon') self:preprocess_equals('', '2 septilijona') self:preprocess_equals('', '3 septilijone') self:preprocess_equals('', '4 septilijone') self:preprocess_equals('', '5 septilijonov') self:preprocess_equals('', '6 septilijonov') self:preprocess_equals('', '7 septilijonov') self:preprocess_equals('', '6,5 septilijona') self:preprocess_equals('', '1 septilijarda') self:preprocess_equals('', '2 septilijardi') self:preprocess_equals('', '3 septilijarde') self:preprocess_equals('', '4 septilijarde') self:preprocess_equals('', '5 septilijard') self:preprocess_equals('', '6 septilijard') self:preprocess_equals('', '7 septilijard') self:preprocess_equals('', '6,5 septilijarde') end

function p:test_wordify_German self:preprocess_equals('', '1 Septillion') self:preprocess_equals('', '2 Septillionen') self:preprocess_equals('', '1 Septilliarde') self:preprocess_equals('', '2 Septilliarden') self:preprocess_equals('', '1 Septillion') self:preprocess_equals('', '2 Septillionen') self:preprocess_equals('', '1 Septillion') self:preprocess_equals('', '2 Septillionen') self:preprocess_equals('', '1 Septillion') self:preprocess_equals('', '2 Septillionen') self:preprocess_equals('', '1 Septillion') self:preprocess_equals('', '2 Septillionen') self:preprocess_equals('', '1 Septillion') self:preprocess_equals('', '2 Septillionen') self:preprocess_equals('', '1 Septillion') self:preprocess_equals('', '2 Septillionen') self:preprocess_equals('', '1 Septillion') self:preprocess_equals('', '2 Septillionen') self:preprocess_equals('', '1 Septillion') self:preprocess_equals('', '2 Septillionen') self:preprocess_equals('', '1 Septillion') self:preprocess_equals('', '2 Septillionen') self:preprocess_equals('', '1 Septillion') self:preprocess_equals('', '2 Septillionen') self:preprocess_equals('', '1 Septillion') self:preprocess_equals('', '2 Septillionen') self:preprocess_equals('', '1 Septillion') self:preprocess_equals('', '2 Septillionen') end

function p:test_wordify_Luxembourgish self:preprocess_equals('', '1 Quadrillioun') self:preprocess_equals('', '2 Quadrilliounen') self:preprocess_equals('', '1 Quadrilliard') self:preprocess_equals('', '2 Quadrilliarden') self:preprocess_equals('', '1 Quadrillioun') self:preprocess_equals('', '2 Quadrilliounen') self:preprocess_equals('', '1 Quadrillioun') self:preprocess_equals('', '2 Quadrilliounen') self:preprocess_equals('', '1 Quadrillioun') self:preprocess_equals('', '2 Quadrilliounen') end

function p:test_wordify_Latin self:preprocess_equals('', '1 septillio') self:preprocess_equals('', '2 septillionia') self:preprocess_equals('', '2 septillionia') self:preprocess_equals('', '2 septilliones') self:preprocess_equals('', '2 septilliones') self:preprocess_equals('', '1 septilliardum') self:preprocess_equals('', '2 septilliarda') end

function p:test_wordify_Esperanto self:preprocess_equals('', '1 sepiliono') self:preprocess_equals('', '2 sepilionoj') end

function p:test_wordify_Dutch self:preprocess_equals('', '1 septiljoen') self:preprocess_equals('', '2 septiljoen') end

function p:test_wordify_Afrikaans self:preprocess_equals('', '1 septiljoen') self:preprocess_equals('', '2 septiljoen') end

function p:test_wordify_Norwegian self:preprocess_equals('', '1 septillion') self:preprocess_equals('', '2 septillioner') self:preprocess_equals('', '1 septillionen') self:preprocess_equals('', '2 septillionene') self:preprocess_equals('', '1 septillion') self:preprocess_equals('', '2 septillioner') self:preprocess_equals('', '1 septillionen') self:preprocess_equals('', '2 septillionene') self:preprocess_equals('', '1 septillions') self:preprocess_equals('', '2 septillioners') self:preprocess_equals('', '1 septillionens') self:preprocess_equals('', '2 septillionenes') self:preprocess_equals('', '1 septillion') self:preprocess_equals('', '2 septillioner') self:preprocess_equals('', '1 septillionen') self:preprocess_equals('', '2 septillionene') self:preprocess_equals('', '1 septillions') self:preprocess_equals('', '2 septillioners') self:preprocess_equals('', '1 septillionens') self:preprocess_equals('', '2 septillionenes') self:preprocess_equals('', '1 septillion') self:preprocess_equals('', '2 septillioner') self:preprocess_equals('', '1 septillionen') self:preprocess_equals('', '2 septillionene') self:preprocess_equals('', '1 septillions') self:preprocess_equals('', '2 septillioners') self:preprocess_equals('', '1 septillionens') self:preprocess_equals('', '2 septillionenes') self:preprocess_equals('', '1 septillion') self:preprocess_equals('', '2 septillioner') self:preprocess_equals('', '1 septillionen') self:preprocess_equals('', '2 septillionene') self:preprocess_equals('', '1 septillions') self:preprocess_equals('', '2 septillioners') self:preprocess_equals('', '1 septillionens') self:preprocess_equals('', '2 septillionenes') end

function p:test_wordify_Swedish self:preprocess_equals('', '1 miljard') self:preprocess_equals('', '1 septiljon') self:preprocess_equals('', '2 septiljoner') self:preprocess_equals('', '1 septiljonen') self:preprocess_equals('', '2 septiljonerna') self:preprocess_equals('', '1 septiljon') self:preprocess_equals('', '2 septiljoner') self:preprocess_equals('', '1 septiljonen') self:preprocess_equals('', '2 septiljonerna') self:preprocess_equals('', '1 septiljons') self:preprocess_equals('', '2 septiljoners') self:preprocess_equals('', '1 septiljonens') self:preprocess_equals('', '2 septiljonernas') end

function p:test_wordify_Japanese self:preprocess_equals('', '1万') self:preprocess_equals('', '11万') self:preprocess_equals('', '11.1万') self:preprocess_equals('', '秭') end

function p:test_wordify_Korean self:preprocess_equals('', '1만') self:preprocess_equals('', '11만') self:preprocess_equals('', '11.1만') self:preprocess_equals('', '자') self:preprocess_equals('', '1萬') self:preprocess_equals('', '11萬') self:preprocess_equals('', '11.1萬') self:preprocess_equals('', '秭') end

function p:test_wordify_Chinese self:preprocess_equals('', '1万') self:preprocess_equals('', '11万') self:preprocess_equals('', '11.1万') self:preprocess_equals('', '秭') self:preprocess_equals('', '1萬') self:preprocess_equals('', '11萬') self:preprocess_equals('', '11.1萬') self:preprocess_equals('', '秭') end

function p:test_wordify_error self:preprocess_equals('', err("Not a number: Bad")) self:preprocess_equals('', err('Not a number: Bad ')) end

return p