summaryrefslogtreecommitdiff
blob: 2b45be985bba0118ac47634359b61b41bb329871 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
On 32-bit systems Hourglass silently breaks dates
out of range '1970 +- 68' years due to use of
'time_t' and 'gmtime_r' from installed libc.

Workaround test failures by not testing times out of this range.

Github-bug: https://github.com/vincenthz/hs-hourglass/issues/21
Github-bug: https://github.com/vincenthz/hs-asn1/issues/12
diff --git a/tests/Tests.hs b/tests/Tests.hs
index 5a82ec9..525de82 100644
--- a/tests/Tests.hs
+++ b/tests/Tests.hs
@@ -88,7 +88,10 @@ instance Arbitrary BitArray where
 
 instance Arbitrary Date where
     arbitrary = do
-        y <- choose (1951, 2050)
+        -- 2037 and not 2050
+        -- due to a limitation of 'timeConvert' on 32-bit systems:
+        --  https://github.com/vincenthz/hs-hourglass/issues/21
+        y <- choose (1951, 2037)
         m <- elements [ January .. December]
         d <- choose (1, 30)
         return $ normalizeDate $ Date y m d