aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/data/bit.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/data/bit.lux')
-rw-r--r--stdlib/source/test/lux/data/bit.lux35
1 files changed, 17 insertions, 18 deletions
diff --git a/stdlib/source/test/lux/data/bit.lux b/stdlib/source/test/lux/data/bit.lux
index 6f281818d..0be42e466 100644
--- a/stdlib/source/test/lux/data/bit.lux
+++ b/stdlib/source/test/lux/data/bit.lux
@@ -1,8 +1,8 @@
(.module:
[lux #*
- ["%" data/text/format (#+ format)]
["_" test (#+ Test)]
- ["r" math/random]
+ [math
+ ["." random]]
[abstract
[monad (#+ do)]
{[0 #spec]
@@ -17,21 +17,20 @@
(def: #export test
Test
- (<| (_.context (%.name (name-of .Bit)))
- (do r.monad
- [value r.bit]
+ (<| (_.covering /._)
+ (do random.monad
+ [value random.bit]
($_ _.and
- ($equivalence.spec /.equivalence r.bit)
- ($codec.spec /.equivalence /.codec r.bit)
- (<| (_.context "Disjunction.")
- ($monoid.spec /.equivalence /.disjunction r.bit))
- (<| (_.context "Conjunction.")
- ($monoid.spec /.equivalence /.conjunction r.bit))
- (_.test "A value cannot be true and false at the same time."
- (not (and value (not value))))
- (_.test "A value must be either true or false at any time."
- (or value (not value)))
- (_.test "Can create the complement of a predicate."
- (and (not (:: /.equivalence = value ((/.complement function.identity) value)))
- (:: /.equivalence = value ((/.complement not) value))))
+ (_.with-cover [/.equivalence]
+ ($equivalence.spec /.equivalence random.bit))
+ (_.with-cover [/.disjunction]
+ ($monoid.spec /.equivalence /.disjunction random.bit))
+ (_.with-cover [/.conjunction]
+ ($monoid.spec /.equivalence /.conjunction random.bit))
+ (_.with-cover [/.codec]
+ ($codec.spec /.equivalence /.codec random.bit))
+
+ (_.cover [/.complement]
+ (and (not (:: /.equivalence = value ((/.complement function.identity) value)))
+ (:: /.equivalence = value ((/.complement not) value))))
))))