aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/time/month.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/time/month.lux37
1 files changed, 37 insertions, 0 deletions
diff --git a/stdlib/source/test/lux/time/month.lux b/stdlib/source/test/lux/time/month.lux
new file mode 100644
index 000000000..4c9365bb6
--- /dev/null
+++ b/stdlib/source/test/lux/time/month.lux
@@ -0,0 +1,37 @@
+(.module:
+ [lux #*
+ data/text/format
+ ["_" test (#+ Test)]
+ [control
+ {[0 #test]
+ [/
+ ["$." equivalence]
+ ["$." order]
+ ["$." enum]]}]
+ [math
+ ["r" random (#+ Random) ("#@." monad)]]]
+ {1
+ ["." / (#+ Month)]})
+
+(def: #export month
+ (Random Month)
+ (r.either (r.either (r.either (r@wrap #/.January)
+ (r.either (r@wrap #/.February)
+ (r@wrap #/.March)))
+ (r.either (r@wrap #/.April)
+ (r.either (r@wrap #/.May)
+ (r@wrap #/.June))))
+ (r.either (r.either (r@wrap #/.July)
+ (r.either (r@wrap #/.August)
+ (r@wrap #/.September)))
+ (r.either (r@wrap #/.October)
+ (r.either (r@wrap #/.November)
+ (r@wrap #/.December))))))
+
+(def: #export test
+ Test
+ ($_ _.and
+ ($equivalence.spec /.equivalence ..month)
+ ($order.spec /.order ..month)
+ ($enum.spec /.enum ..month)
+ ))