From 2c99b4515447315d76a8dc203a2dbcafc09506ea Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 17 Jul 2021 01:48:49 -0400 Subject: Now properly loading cached modules. --- stdlib/source/test/aedifex/artifact/time/date.lux | 36 ++++++++++++++++++----- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'stdlib/source/test/aedifex/artifact/time/date.lux') 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 (.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))) + )))) -- cgit v1.2.3