Jump to content

Module talk:Roman/testcases

Page contents not supported in other languages.
Add topic
From Wikisource

All 55 tests passed.

test_1__number__toRoman__toArabic
Text Expected Actual
YesY roman.toArabic(roman._Numeral(0)) 0 0
YesY roman.toArabic(roman._Numeral(5001)) 5001 5001
YesY roman.toArabic(roman._Numeral(7468)) 7468 7468
YesY roman.toArabic(roman._Numeral(10000)) 10000 10000
YesY roman.toArabic(roman._Numeral(12345)) 12345 12345
YesY roman.toArabic(roman._Numeral(13798)) 13798 13798
YesY roman.toArabic(roman._Numeral(21856)) 21856 21856
YesY roman.toArabic(roman._Numeral(123456)) 123456 123456
YesY roman.toArabic(roman._Numeral(1048576)) 1048576 1048576
YesY roman.toArabic(roman._Numeral(4999999999)) 4999999999 4999999999
test_2_Roman__shorter
Text Expected Actual
YesY {{#invoke:Roman/sandbox|Numeral|9999}} I̅X̅CMXCIX I̅X̅CMXCIX
YesY {{#invoke:Roman/sandbox|Numeral|14999}} X̅I̅V̅CMXCIX X̅I̅V̅CMXCIX
YesY {{#invoke:Roman/sandbox|Numeral|34850}} X̅X̅X̅I̅V̅DCCCL X̅X̅X̅I̅V̅DCCCL
test_3_Roman__misc__formatting
Text Expected Actual
YesY {{#invoke:Roman/sandbox|Numeral|0}} N N
YesY {{#invoke:Roman/sandbox|Numeral| 1}} I I
YesY {{#invoke:Roman/sandbox|Numeral|04}} IV IV
YesY {{#invoke:Roman/sandbox|Numeral|0004}} IV IV
YesY {{#invoke:Roman/sandbox|Numeral| 04 }} IV IV
YesY {{#invoke:Roman/sandbox|Numeral|5987654321}} 5987654321 5987654321
test_4_isRoman
Text Expected Actual
YesY roman.isRoman("") false false
YesY roman.isRoman("AbCd") false false
YesY roman.isRoman("第") false false
YesY roman.isRoman("34") false false
YesY roman.isRoman("I") true true
YesY roman.isRoman("ⅩⅣ") true true
YesY roman.isRoman("V̅") true true
test_5_Roman__toArabic
Text Expected Actual
YesY roman.toArabic("") nil nil
YesY roman.toArabic("AbCd") nil nil
YesY roman.toArabic("第") nil nil
YesY roman.toArabic("34") 34 34
YesY roman.toArabic(" I ") 1 1
YesY roman.toArabic("ⅩⅣ") 14 14
YesY roman.toArabic(" V̅ ") 5000 5000
YesY roman.toArabic("I") 1 1
YesY roman.toArabic("II") 2 2
YesY roman.toArabic("IV") 4 4
YesY roman.toArabic("XIV") 14 14
YesY roman.toArabic("XLIX") 49 49
YesY roman.toArabic("L") 50 50
YesY roman.toArabic("LI") 51 51
YesY roman.toArabic("CI") 101 101
YesY roman.toArabic("CCIII") 203 203
YesY roman.toArabic("DX") 510 510
YesY roman.toArabic("CMXCIX") 999 999
YesY roman.toArabic("M") 1000 1000
YesY roman.toArabic("MXXIV") 1024 1024
YesY roman.toArabic("MCMLXXIX") 1979 1979
YesY roman.toArabic("MM") 2000 2000
YesY roman.toArabic("MMXI") 2011 2011
YesY roman.toArabic("MMCMXCIX") 2999 2999
YesY roman.toArabic("MMM") 3000 3000
YesY roman.toArabic("MMMI") 3001 3001
YesY roman.toArabic("MMMMCMLXXXVII") 4987 4987
YesY roman.toArabic("MMMMCMXCIX") 4999 4999
YesY roman.toArabic("V̅") 5000 5000

Start a discussion about Module:Roman/testcases

Start a discussion