Permalink
Browse files

Extend the test cases

  • Loading branch information...
adomokos committed Nov 5, 2018
1 parent 76693b3 commit 11ad84525034d586bf3e6127078bf70a6b26b9ef
Showing with 25 additions and 5 deletions.
  1. +25 −5 test/RomanNumeralsSpec.hs
@@ -10,7 +10,13 @@ type Conversions = [(Int, Roman)]
conversions :: Conversions
conversions =
[ (4, "IV")
[ (90, "XC")
, (50, "L")
, (40, "XL")
, (10, "X")
, (9, "IX")
, (5, "V")
, (4, "IV")
, (1, "I") ]
convertToRoman :: Int -> Roman
@@ -27,11 +33,25 @@ convertFromRoman "" = undefined
spec :: Spec
spec =
describe "Converting to Roman Numerals" $ do
it "converts 1 to I" $
it "converts 1 to I" $ do
convertToRoman 1 `shouldBe` "I"
it "converts 2 to II" $
it "converts 2 to II" $ do
convertToRoman 2 `shouldBe` "II"
it "converts 3 to III" $
it "converts 3 to III" $ do
convertToRoman 3 `shouldBe` "III"
it "converts 4 to IV" $
it "converts 4 to IV" $ do
convertToRoman 4 `shouldBe` "IV"
it "converts 5 to V" $ do
convertToRoman 5 `shouldBe` "V"
it "converts 6 to VI" $ do
convertToRoman 6 `shouldBe` "VI"
it "converts 8 to VIII" $ do
convertToRoman 8 `shouldBe` "VIII"
it "converts 9 to IX" $ do
convertToRoman 9 `shouldBe` "IX"
it "converts 10 to X" $ do
convertToRoman 10 `shouldBe` "X"
it "converts 11 to XI" $ do
convertToRoman 11 `shouldBe` "XI"
it "converts 99 to L" $ do
convertToRoman 99 `shouldBe` "XCIX"

0 comments on commit 11ad845

Please sign in to comment.