aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/time/day.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/time/day.lux32
1 files changed, 32 insertions, 0 deletions
diff --git a/stdlib/source/test/lux/time/day.lux b/stdlib/source/test/lux/time/day.lux
new file mode 100644
index 000000000..e0142d1b4
--- /dev/null
+++ b/stdlib/source/test/lux/time/day.lux
@@ -0,0 +1,32 @@
+(.module:
+ [lux #*
+ data/text/format
+ ["_" test (#+ Test)]
+ [control
+ {[0 #test]
+ [/
+ ["$." equivalence]
+ ["$." order]
+ ["$." enum]]}]
+ [math
+ ["r" random (#+ Random) ("#@." monad)]]]
+ {1
+ ["." / (#+ Day)]})
+
+(def: #export day
+ (Random Day)
+ (r.either (r.either (r.either (r@wrap #/.Sunday)
+ (r@wrap #/.Monday))
+ (r.either (r@wrap #/.Tuesday)
+ (r@wrap #/.Wednesday)))
+ (r.either (r.either (r@wrap #/.Thursday)
+ (r@wrap #/.Friday))
+ (r@wrap #/.Saturday))))
+
+(def: #export test
+ Test
+ ($_ _.and
+ ($equivalence.spec /.equivalence ..day)
+ ($order.spec /.order ..day)
+ ($enum.spec /.enum ..day)
+ ))