aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/math/logic/continuous.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/math/logic/continuous.lux')
-rw-r--r--stdlib/source/test/lux/math/logic/continuous.lux35
1 files changed, 35 insertions, 0 deletions
diff --git a/stdlib/source/test/lux/math/logic/continuous.lux b/stdlib/source/test/lux/math/logic/continuous.lux
new file mode 100644
index 000000000..b9db253f6
--- /dev/null
+++ b/stdlib/source/test/lux/math/logic/continuous.lux
@@ -0,0 +1,35 @@
+(.module:
+ [lux #*
+ [control
+ [monad (#+ do)]]
+ [math
+ ["r" random]
+ [logic
+ ["&" continuous]]]]
+ lux/test)
+
+(context: "Operations"
+ (<| (times 100)
+ (do @
+ [left r.rev
+ right r.rev]
+ ($_ seq
+ (test "AND is the minimum."
+ (let [result (&.and left right)]
+ (and (r/<= left result)
+ (r/<= right result))))
+
+ (test "OR is the maximum."
+ (let [result (&.or left right)]
+ (and (r/>= left result)
+ (r/>= right result))))
+
+ (test "Double negation results in the original value."
+ (r/= left (&.not (&.not left))))
+
+ (test "Every value is equivalent to itself."
+ (and (r/>= left
+ (&.= left left))
+ (r/>= right
+ (&.= right right))))
+ ))))