diff options
author | Eduardo Julian | 2020-12-02 20:37:13 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-12-02 20:37:13 -0400 |
commit | 28c724857d76afdc40b5b036f415cc151eb66263 (patch) | |
tree | 3e970ca2a10dd7bb5c7ddd405349762945464d39 /stdlib/source/test/lux/data/number/frac.lux | |
parent | 34e310622bdeb1d0588c0664c0e78cbaa84f837c (diff) |
Replaced "contains?" function with "key?" function.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/data/number/frac.lux | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/stdlib/source/test/lux/data/number/frac.lux b/stdlib/source/test/lux/data/number/frac.lux index ca3d4d21c..b9669756d 100644 --- a/stdlib/source/test/lux/data/number/frac.lux +++ b/stdlib/source/test/lux/data/number/frac.lux @@ -10,7 +10,9 @@ ["$." monoid] ["$." codec]]}] [data - ["." bit ("#\." equivalence)]] + ["." bit ("#\." equivalence)] + [text + ["%" format (#+ format)]]] [math ["." random (#+ Random)]]] {1 @@ -32,14 +34,15 @@ ($equivalence.spec /.equivalence random.safe-frac)) (_.with-cover [/.order /.<] ($order.spec /.order random.safe-frac)) - (~~ (template [<monoid> <compose>] + (~~ (template [<compose> <monoid>] [(_.with-cover [<monoid> <compose>] ($monoid.spec /.equivalence <monoid> ..random))] - [/.addition /.+] - [/.multiplication /.*] - [/.minimum /.min] - [/.maximum /.max] + [/.+ /.addition] + [/.* /.multiplication] + + [/.min /.minimum] + [/.max /.maximum] )) (~~ (template [<codec>] [(_.with-cover [<codec>] @@ -161,16 +164,21 @@ (/.* (/.signum sample) sample))))) (do random.monad [expected random.frac] - ($_ _.and - (_.cover [/.to-bits /.from-bits] - (let [actual (|> expected /.to-bits /.from-bits)] - (or (/.= expected actual) - (and (/.not-a-number? expected) - (/.not-a-number? actual))))) - (_.cover [/.negate] - (and (/.= +0.0 (/.+ (/.negate expected) expected)) - (|> expected /.negate /.negate (/.= expected)))) - )) + (_.cover [/.to-bits /.from-bits] + (let [actual (|> expected /.to-bits /.from-bits)] + (or (/.= expected actual) + (and (/.not-a-number? expected) + (/.not-a-number? actual)))))) + (do random.monad + [expected random.safe-frac] + (_.cover [/.negate] + (let [subtraction! + (/.= +0.0 (/.+ (/.negate expected) expected)) + + inverse! + (|> expected /.negate /.negate (/.= expected))] + (and subtraction! + inverse!)))) ..signature ..constant |