diff options
author | Eduardo Julian | 2021-07-17 01:48:49 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-07-17 01:48:49 -0400 |
commit | 2c99b4515447315d76a8dc203a2dbcafc09506ea (patch) | |
tree | abb913a594de33855b49a218e7728417fa0f850b /stdlib/source/test/aedifex/artifact/time | |
parent | bfacc0c96e56eedf788aba44bd8ad2848a35c390 (diff) |
Now properly loading cached modules.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/aedifex/artifact/time/date.lux | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/stdlib/source/test/aedifex/artifact/time/date.lux b/stdlib/source/test/aedifex/artifact/time/date.lux index e68645b8a..35ae3a157 100644 --- a/stdlib/source/test/aedifex/artifact/time/date.lux +++ b/stdlib/source/test/aedifex/artifact/time/date.lux @@ -3,9 +3,12 @@ [lux #* ["_" test (#+ Test)] [abstract - [monad (#+ do)]] + [monad (#+ do)] + [\\specification + ["$." equivalence]]] [control ["." try ("#\." functor)] + ["." exception] [parser ["<.>" text]]] [math @@ -14,7 +17,7 @@ ["n" nat] ["i" int]]] [time - ["." date] + ["." date ("#\." equivalence)] ["." year]]]] [\\program ["." /]]) @@ -35,13 +38,32 @@ Test (<| (_.covering /._) (_.for [/.Date]) - ($_ _.and - (do random.monad - [expected ..random] + (do random.monad + [expected ..random + candidate random.date] + ($_ _.and + (_.for [/.equivalence] + ($equivalence.spec /.equivalence ..random)) + (_.cover [/.format /.parser] (|> expected /.format (<text>.run /.parser) (try\map (\ /.equivalence = expected)) - (try.default false)))) - ))) + (try.default false))) + (_.cover [/.value /.date] + (|> expected + /.value + /.date + (try\map (\ /.equivalence = expected)) + (try.default false))) + (_.cover [/.year_is_out_of_range] + (case (/.date candidate) + (#try.Success date) + (is? candidate (/.value date)) + + (#try.Failure error) + (exception.match? /.year_is_out_of_range error))) + (_.cover [/.epoch] + (date\= date.epoch (/.value /.epoch))) + )))) |