diff options
author | Eduardo Julian | 2019-04-12 23:42:21 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-04-12 23:42:21 -0400 |
commit | f3957974e63756a7dce0239b3a5bdbaa40e62d5e (patch) | |
tree | b615d41b0c1e32626ba8c8bab8a478d7e479d686 /stdlib/source/test | |
parent | 69d3c6200daf0570f27b719f2e12f06235b4077b (diff) |
Fixed some bugs.
Diffstat (limited to 'stdlib/source/test')
-rw-r--r-- | stdlib/source/test/lux.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/logic/fuzzy.lux | 30 | ||||
-rw-r--r-- | stdlib/source/test/lux/time/date.lux | 10 |
3 files changed, 17 insertions, 25 deletions
diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index fa6a511d5..d9b3df35e 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -381,6 +381,4 @@ (<| io _.run! (_.times 100) - ## (_.seed 8804587020128699091) - ## (_.seed 9353282359333487462) ..test)) diff --git a/stdlib/source/test/lux/math/logic/fuzzy.lux b/stdlib/source/test/lux/math/logic/fuzzy.lux index 10b75195a..64051ffd9 100644 --- a/stdlib/source/test/lux/math/logic/fuzzy.lux +++ b/stdlib/source/test/lux/math/logic/fuzzy.lux @@ -116,28 +116,26 @@ right ..triangle sample r.rev] ($_ _.and - (_.test "Union membership as as high as membership in any of its members." + (_.test (%name (name-of /.union)) (let [combined (/.union left right) combined-membership (/.membership sample combined)] (and (r/>= (/.membership sample left) combined-membership) (r/>= (/.membership sample right) combined-membership)))) - (_.test "Intersection membership as as low as membership in any of its members." + (_.test (%name (name-of /.intersection)) (let [combined (/.intersection left right) combined-membership (/.membership sample combined)] (and (r/<= (/.membership sample left) combined-membership) (r/<= (/.membership sample right) combined-membership)))) - (_.test "Complement membership is the opposite of normal membership." + (_.test (%name (name-of /.complement)) (r/= (/.membership sample left) (//.not (/.membership sample (/.complement left))))) - (_.test "Membership in the difference will never be higher than in the set being subtracted." - (bit@= (r/> (/.membership sample right) - (/.membership sample left)) - (r/< (/.membership sample left) - (/.membership sample (/.difference left right))))) + (_.test (%name (name-of /.difference)) + (r/<= (/.membership sample right) + (/.membership sample (/.difference left right)))) )))) (def: predicates-and-sets @@ -146,16 +144,12 @@ [#let [set-10 (set.from-list nat.hash (list.n/range 0 10))] sample (|> r.nat (:: @ map (n/% 20)))] ($_ _.and - (<| (_.context (%name (name-of /.from-predicate))) - (_.test (format "Values that satisfy a predicate have membership = 1." - "Values that don't have membership = 0.") - (bit@= (r/= //.true (/.membership sample (/.from-predicate n/even?))) - (n/even? sample)))) - (<| (_.context (%name (name-of /.from-set))) - (_.test (format "Values that belong to a set have membership = 1." - "Values that don't have membership = 0.") - (bit@= (r/= //.true (/.membership sample (/.from-set set-10))) - (set.member? set-10 sample)))) + (_.test (%name (name-of /.from-predicate)) + (bit@= (r/= //.true (/.membership sample (/.from-predicate n/even?))) + (n/even? sample))) + (_.test (%name (name-of /.from-set)) + (bit@= (r/= //.true (/.membership sample (/.from-set set-10))) + (set.member? set-10 sample))) ))) (def: thresholds diff --git a/stdlib/source/test/lux/time/date.lux b/stdlib/source/test/lux/time/date.lux index 483b51388..cd03bca37 100644 --- a/stdlib/source/test/lux/time/date.lux +++ b/stdlib/source/test/lux/time/date.lux @@ -9,17 +9,17 @@ [/ ["$." equivalence] ["$." order] - ["$." codec]]}] - [time - ["@." instant]]] + ["$." codec]]}]] [// ["_." instant]] {1 - ["." / (#+ Date)]}) + ["." / (#+ Date) + ["." // #_ + ["#." instant]]]}) (def: #export date (Random Date) - (|> _instant.instant (:: r.monad map @instant.date))) + (|> _instant.instant (:: r.monad map //instant.date))) (def: #export test Test |