Commits

Bryan O'Sullivan  committed df0b3ba

Bump version

  • Participants
  • Parent commits 42c51bd

Comments (0)

Files changed (2)

 name:            aeson
-version:         0.3.2.3
+version:         0.3.2.4
 license:         BSD3
 license-file:    LICENSE
 category:        Text, Web, JSON

File tests/Properties.hs

-{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-}
 
 import Data.Aeson.Encode
 import Data.Aeson.Parser (value)
 import qualified Data.ByteString.Lazy.Char8 as L
 import qualified Data.Attoparsec.Lazy as L
 
-encodeDouble d  = encode (Number (D d)) == L.pack (show d)
+encodeDouble num denom
+    | isInfinite d || isNaN d = encode (Number (D d)) == "null"
+    | otherwise               = encode (Number (D d)) == L.pack (show d)
+  where d = num / denom
 encodeInteger i = encode (Number (I i)) == L.pack (show i)
 
 roundTrip :: (Eq a, FromJSON a, ToJSON a) => a -> Bool