From 6f3b5f0f75f019a5d030872babe4e585a6bd942b Mon Sep 17 00:00:00 2001 From: Jay Pedersen Date: Fri, 22 May 2020 23:25:10 -0500 Subject: makeRomanNumeral bug fix, added MMMMM test (#216) Co-authored-by: jay --- examples/romanNumerals.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/romanNumerals.py b/examples/romanNumerals.py index 932daa6..9ed4c92 100644 --- a/examples/romanNumerals.py +++ b/examples/romanNumerals.py @@ -45,7 +45,7 @@ romanNumeral = numeral[1, ...].setParseAction(sum) # unit tests def makeRomanNumeral(n): def addDigits(n, limit, c, s): - while n > limit: + while n >= limit: n -= limit s += c return n, s @@ -95,6 +95,7 @@ romanNumeral.runTests( XIX MCMLXXX MMVI + MMMMM """, fullDump=False, postParse=verify_value, -- cgit v1.2.1