| 1 | From 58766a1916b4980792763bab74f0c86e2a7ebf20 Mon Sep 17 00:00:00 2001
|
| 2 | From: Oleg Grenrus <[email protected]>
|
| 3 | Date: Thu, 1 Jun 2023 22:58:28 +0300
|
| 4 | Subject: [PATCH] QC-2.14.3 Double generators generates infinite number too
|
| 5 |
|
| 6 | ---
|
| 7 | tests/PropUtils.hs | 5 +++--
|
| 8 | 1 file changed, 3 insertions(+), 2 deletions(-)
|
| 9 |
|
| 10 | diff --git a/tests/PropUtils.hs b/tests/PropUtils.hs
|
| 11 | index 3c449029a..43de85d7f 100644
|
| 12 | |
| 13 | |
| 14 | @@ -51,8 +51,9 @@ import qualified Data.Aeson.Decoding as Dec
|
| 15 |
|
| 16 | encodeDouble :: Double -> Double -> Property
|
| 17 | encodeDouble num denom
|
| 18 | - | isInfinite d || isNaN d = encode d === "null"
|
| 19 | - | otherwise = (read . L.unpack . encode) d === d
|
| 20 | + | isNaN d = encode d === "null"
|
| 21 | + | isInfinite d = if d > 0 then encode d === "\"+inf\"" else encode d === "\"-inf\""
|
| 22 | + | otherwise = (read . L.unpack . encode) d === d
|
| 23 | where d = num / denom
|
| 24 |
|
| 25 | encodeInteger :: Integer -> Property
|