aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/artifact/time
diff options
context:
space:
mode:
authorEduardo Julian2021-06-12 01:32:40 -0400
committerEduardo Julian2021-06-12 01:32:40 -0400
commitaf3e6e2cb011dc2ad9204440990731a2f272716d (patch)
tree3521c74b05fc5b3ddddbe901d32ace87dbb6c018 /stdlib/source/test/aedifex/artifact/time
parent8f575da5095e3b259d4eb6b6f13d3e37ef1d38e4 (diff)
Constraining the year of the snapshot time in Aedifex.
Diffstat (limited to 'stdlib/source/test/aedifex/artifact/time')
-rw-r--r--stdlib/source/test/aedifex/artifact/time/date.lux16
1 files changed, 9 insertions, 7 deletions
diff --git a/stdlib/source/test/aedifex/artifact/time/date.lux b/stdlib/source/test/aedifex/artifact/time/date.lux
index 932d1698e..a68a60a56 100644
--- a/stdlib/source/test/aedifex/artifact/time/date.lux
+++ b/stdlib/source/test/aedifex/artifact/time/date.lux
@@ -13,25 +13,27 @@
["n" nat]
["i" int]]]
[time
- ["." date (#+ Date)]
+ ["." date]
["." year]]]
{#program
["." /]})
(def: #export random
- (Random Date)
+ (Random /.Date)
(random.one (function (_ raw)
(try.to_maybe
(do try.monad
- [year (|> raw date.year year.value i.abs (i.% +9,000) (i.+ +1,000) year.year)]
- (date.date year
- (date.month raw)
- (date.day_of_month raw)))))
+ [year (|> raw date.year year.value i.abs (i.% +9,000) (i.+ +1,000) year.year)
+ raw (date.date year
+ (date.month raw)
+ (date.day_of_month raw))]
+ (/.date raw))))
random.date))
(def: #export test
Test
(<| (_.covering /._)
+ (_.for [/.Date])
($_ _.and
(do random.monad
[expected ..random]
@@ -39,6 +41,6 @@
(|> expected
/.format
(<text>.run /.parser)
- (try\map (\ date.equivalence = expected))
+ (try\map (\ /.equivalence = expected))
(try.default false))))
)))