Skip to content

Commit 88d6486

Browse files
author
RyanGlScott
committed
Spread assertions across different tests
1 parent ac4c8ae commit 88d6486

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/Numeric/CompatSpec.hs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@ main = hspec spec
88

99
spec :: Spec
1010
spec = do
11-
describe "showFFloatAlt" $
12-
it "shows a RealFloat value, always using decimal notation" $ do
11+
describe "showFFloatAlt" $ do
12+
it "shows a RealFloat value, always using decimal notation" $
1313
showFFloatAlt Nothing (12 :: Double) "" `shouldBe` "12.0"
14+
it "allows to specify the number of decimal places" $
1415
showFFloatAlt (Just 4) (12 :: Double) "" `shouldBe` "12.0000"
15-
describe "showGFloatAlt" $
16-
it "shows a RealFloat value, using decimal or scientific notation depending on the value" $ do
16+
describe "showGFloatAlt" $ do
17+
it "shows a RealFloat value, using decimal notation if the absolute value lies between 0.1 and 9,999,999" $
1718
showGFloatAlt Nothing (12 :: Double) "" `shouldBe` "12.0"
19+
it "shows a RealFloat value, using decimal notation and specifying the number of decimal places" $
1820
showGFloatAlt (Just 4) (12 :: Double) "" `shouldBe` "12.0000"
21+
it "shows a RealFloat value, using scientific notation if the absolute value falls outside of the range" $
1922
showGFloatAlt Nothing (1234567890 :: Double) "" `shouldBe` "1.23456789e9"
23+
it "shows a RealFloat value, using scientific notation and specifying the number of decimal places" $
2024
showGFloatAlt (Just 4) (1234567890 :: Double) "" `shouldBe` "1.2346e9"

0 commit comments

Comments
 (0)