aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/aedifex')
-rw-r--r--stdlib/source/test/aedifex/artifact.lux3
-rw-r--r--stdlib/source/test/aedifex/artifact/time_stamp.lux33
2 files changed, 35 insertions, 1 deletions
diff --git a/stdlib/source/test/aedifex/artifact.lux b/stdlib/source/test/aedifex/artifact.lux
index 60619f78b..dc2de91f7 100644
--- a/stdlib/source/test/aedifex/artifact.lux
+++ b/stdlib/source/test/aedifex/artifact.lux
@@ -21,7 +21,7 @@
["." / #_
["#." type]
["#." extension]
- ["#." time_stamp #_
+ ["#." time_stamp
["#/." date]
["#/." time]]]
{#program
@@ -45,6 +45,7 @@
/type.test
/extension.test
+ /time_stamp.test
/time_stamp/date.test
/time_stamp/time.test
))))
diff --git a/stdlib/source/test/aedifex/artifact/time_stamp.lux b/stdlib/source/test/aedifex/artifact/time_stamp.lux
new file mode 100644
index 000000000..7dea57392
--- /dev/null
+++ b/stdlib/source/test/aedifex/artifact/time_stamp.lux
@@ -0,0 +1,33 @@
+(.module:
+ [lux #*
+ ["_" test (#+ Test)]
+ [abstract
+ [monad (#+ do)]]
+ [control
+ ["." try ("#\." functor)]
+ [parser
+ ["<.>" text]]]
+ [math
+ ["." random (#+ Random)]
+ [number
+ ["n" nat]
+ ["i" int]]]
+ [time
+ ["." instant]]]
+ {#program
+ ["." /]})
+
+(def: #export test
+ Test
+ (<| (_.covering /._)
+ (_.for [/.Time_Stamp])
+ ($_ _.and
+ (do random.monad
+ [expected random.instant]
+ (_.cover [/.format /.parser]
+ (|> expected
+ /.format
+ (<text>.run /.parser)
+ (try\map (\ instant.equivalence = expected))
+ (try.default false))))
+ )))