File: Regressions.hs

package info (click to toggle)
haskell-double-conversion 2.0.4.1%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 164 kB
  • sloc: haskell: 604; cpp: 170; ansic: 31; makefile: 5
file content (23 lines) | stat: -rwxr-xr-x 621 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module Regressions
    (
      tests
    ) where

import Data.Double.Conversion.Convertable
import Test.HUnit (Assertion, assertEqual)
import Data.Text (unpack)
import Numeric (showFFloat)
import qualified Test.Framework as F
import qualified Test.Framework.Providers.HUnit as F

toShortest_overflow :: Assertion
toShortest_overflow = do
  let val = -2.9658956854023756e-5 :: Double
  assertEqual "rendering a long number doesn't crash"
              (showFFloat Nothing val "") (unpack (toShortest val))

tests :: F.Test
tests = F.testGroup "Regressions"
  [
    F.testCase "toShortest_overflow" toShortest_overflow
  ]