projects/guix·blob python-team · refs

25 lines · 954 B

1From 58766a1916b4980792763bab74f0c86e2a7ebf20 Mon Sep 17 00:00:00 2001
2From: Oleg Grenrus <[email protected]>
3Date: Thu, 1 Jun 2023 22:58:28 +0300
4Subject: [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
10diff --git a/tests/PropUtils.hs b/tests/PropUtils.hs
11index 3c449029a..43de85d7f 100644
12--- a/tests/PropUtils.hs
13+++ b/tests/PropUtils.hs
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