diff options
Diffstat (limited to 'stdlib/source/test/lux/math')
-rw-r--r-- | stdlib/source/test/lux/math/logic/fuzzy.lux | 12 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/modular.lux | 38 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/modulus.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number.lux | 6 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/complex.lux | 12 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/frac.lux | 36 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/i16.lux | 6 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/i32.lux | 6 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/i64.lux | 24 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/i8.lux | 6 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/int.lux | 6 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/nat.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/ratio.lux | 6 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/rev.lux | 28 |
14 files changed, 96 insertions, 96 deletions
diff --git a/stdlib/source/test/lux/math/logic/fuzzy.lux b/stdlib/source/test/lux/math/logic/fuzzy.lux index 2cfc62142..9ea59ccd4 100644 --- a/stdlib/source/test/lux/math/logic/fuzzy.lux +++ b/stdlib/source/test/lux/math/logic/fuzzy.lux @@ -39,10 +39,10 @@ (do [! random.monad] [sample random.rev - threshold_0 (# ! each (r.% .5) - random.rev) - threshold_1 (# ! each (|>> (r.% .5) (r.+ .5)) - random.rev) + threshold_0 (at ! each (r.% .5) + random.rev) + threshold_1 (at ! each (|>> (r.% .5) (r.+ .5)) + random.rev) .let [bottom (r.min threshold_0 threshold_1) top (r.max threshold_0 threshold_1)]] @@ -89,7 +89,7 @@ [bottom middle_bottom middle_top top] (|> random.rev (random.set r.hash 4) - (# ! each (|>> set.list (list.sorted r.<))) + (at ! each (|>> set.list (list.sorted r.<))) (random.one (function (_ thresholds) (case thresholds (pattern (list threshold_0 threshold_1 threshold_2 threshold_3)) @@ -173,7 +173,7 @@ [bottom middle_bottom middle_top top] (|> random.rev (random.set r.hash 4) - (# ! each (|>> set.list (list.sorted r.<))) + (at ! each (|>> set.list (list.sorted r.<))) (random.one (function (_ thresholds) (case thresholds (pattern (list threshold_0 threshold_1 threshold_2 threshold_3)) diff --git a/stdlib/source/test/lux/math/modular.lux b/stdlib/source/test/lux/math/modular.lux index 0137ba9ae..aaf670ba2 100644 --- a/stdlib/source/test/lux/math/modular.lux +++ b/stdlib/source/test/lux/math/modular.lux @@ -30,42 +30,42 @@ (def: .public (random modulus) (All (_ %) (-> (//.Modulus %) (Random (/.Mod %)))) - (# random.monad each - (/.modular modulus) - random.int)) + (at random.monad each + (/.modular modulus) + random.int)) (def: .public test Test (<| (_.covering /._) (_.for [/.Mod]) (do random.monad - [param##% ($//.random +1,000,000) - param (..random param##%) + [param::% ($//.random +1,000,000) + param (..random param::%) - subject##% (random.only (predicate.and (|>> //.divisor (i.> +2)) - (|>> (//.= param##%) not)) + subject::% (random.only (predicate.and (|>> //.divisor (i.> +2)) + (|>> (//.= param::%) not)) ($//.random +1,000,000)) - subject (..random subject##%) - another (..random subject##%)] + subject (..random subject::%) + another (..random subject::%)] (`` (all _.and (_.for [/.equivalence /.=] - ($equivalence.spec /.equivalence (..random subject##%))) + ($equivalence.spec /.equivalence (..random subject::%))) (_.for [/.order /.<] - ($order.spec /.order (..random subject##%))) + ($order.spec /.order (..random subject::%))) (~~ (template [<composite> <monoid>] [(_.for [<monoid> <composite>] - ($monoid.spec /.equivalence (<monoid> subject##%) (..random subject##%)))] + ($monoid.spec /.equivalence (<monoid> subject::%) (..random subject::%)))] [/.+ /.addition] [/.* /.multiplication] )) (_.for [/.codec] - ($codec.spec /.equivalence (/.codec subject##%) (..random subject##%))) + ($codec.spec /.equivalence (/.codec subject::%) (..random subject::%))) (_.coverage [/.incorrect_modulus] (case (|> param - (# (/.codec param##%) encoded) - (# (/.codec subject##%) decoded)) + (at (/.codec param::%) encoded) + (at (/.codec subject::%) decoded)) {try.#Failure error} (exception.match? /.incorrect_modulus error) @@ -107,15 +107,15 @@ (_.coverage [/.adapter] (<| (try.else false) (do try.monad - [copy##% (//.modulus (//.divisor subject##%)) - adapt (/.adapter subject##% copy##%)] + [copy::% (//.modulus (//.divisor subject::%)) + adapt (/.adapter subject::% copy::%)] (in (|> subject /.value - (/.modular copy##%) + (/.modular copy::%) adapt (/.= subject)))))) (_.coverage [/.moduli_are_not_equal] - (case (/.adapter subject##% param##%) + (case (/.adapter subject::% param::%) {try.#Failure error} (exception.match? /.moduli_are_not_equal error) diff --git a/stdlib/source/test/lux/math/modulus.lux b/stdlib/source/test/lux/math/modulus.lux index 029fcbb6d..484a7470a 100644 --- a/stdlib/source/test/lux/math/modulus.lux +++ b/stdlib/source/test/lux/math/modulus.lux @@ -28,7 +28,7 @@ (def: .public (random range) (Ex (_ %) (-> Int (Random (/.Modulus %)))) (|> random.int - (# random.monad each (i.% range)) + (at random.monad each (i.% range)) (random.one (|>> /.modulus try.maybe)))) (def: .public test diff --git a/stdlib/source/test/lux/math/number.lux b/stdlib/source/test/lux/math/number.lux index bda05f0aa..eaa74ac25 100644 --- a/stdlib/source/test/lux/math/number.lux +++ b/stdlib/source/test/lux/math/number.lux @@ -34,7 +34,7 @@ (all _.and (_.coverage [/.bin] (`` (and (~~ (template [<=> <codec> <number>] - [(case (# <codec> decoded (..clean_commas <number>)) + [(case (at <codec> decoded (..clean_commas <number>)) {try.#Success actual} (<=> (/.bin <number>) actual) @@ -53,7 +53,7 @@ ))))) (_.coverage [/.oct] (`` (and (~~ (template [<=> <codec> <number>] - [(case (# <codec> decoded (..clean_commas <number>)) + [(case (at <codec> decoded (..clean_commas <number>)) {try.#Success actual} (<=> (/.oct <number>) actual) @@ -72,7 +72,7 @@ ))))) (_.coverage [/.hex] (`` (and (~~ (template [<=> <codec> <number>] - [(case (# <codec> decoded (..clean_commas <number>)) + [(case (at <codec> decoded (..clean_commas <number>)) {try.#Success actual} (<=> (/.hex <number>) actual) diff --git a/stdlib/source/test/lux/math/number/complex.lux b/stdlib/source/test/lux/math/number/complex.lux index 087ee1245..ee1a6e210 100644 --- a/stdlib/source/test/lux/math/number/complex.lux +++ b/stdlib/source/test/lux/math/number/complex.lux @@ -25,7 +25,7 @@ (def: dimension (Random Frac) (do [! random.monad] - [factor (|> random.nat (# ! each (|>> (n.% 1000) (n.max 1)))) + [factor (|> random.nat (at ! each (|>> (n.% 1000) (n.max 1)))) measure (|> random.safe_frac (random.only (f.> +0.0)))] (in (f.* (|> factor .int int.frac) measure)))) @@ -39,10 +39,10 @@ (def: angle (Random /.Complex) - (# random.monad each - (|>> (revised /.#real (f.% +1.0)) - (revised /.#imaginary (f.% +1.0))) - ..random)) + (at random.monad each + (|>> (revised /.#real (f.% +1.0)) + (revised /.#imaginary (f.% +1.0))) + ..random)) (def: construction Test @@ -257,7 +257,7 @@ Test (do [! random.monad] [sample ..random - degree (|> random.nat (# ! each (|>> (n.max 1) (n.% 5))))] + degree (|> random.nat (at ! each (|>> (n.max 1) (n.% 5))))] (_.coverage [/.roots] (|> sample (/.roots degree) diff --git a/stdlib/source/test/lux/math/number/frac.lux b/stdlib/source/test/lux/math/number/frac.lux index c302d876c..c2e792e8b 100644 --- a/stdlib/source/test/lux/math/number/frac.lux +++ b/stdlib/source/test/lux/math/number/frac.lux @@ -28,7 +28,7 @@ (def: random (Random Frac) - (# random.monad each (|>> (i.% +1,000,000) i.frac) random.int)) + (at random.monad each (|>> (i.% +1,000,000) i.frac) random.int)) (def: constant Test @@ -54,7 +54,7 @@ Test (do [! random.monad] [sample ..random - shift (# ! each /.abs ..random)] + shift (at ! each /.abs ..random)] (all _.and (_.coverage [/.negative?] (bit#= (/.negative? sample) @@ -79,16 +79,16 @@ Test (all _.and (do [! random.monad] - [expected (# ! each (n.% 1,000,000) random.nat)] + [expected (at ! each (n.% 1,000,000) random.nat)] (_.coverage [/.nat] (|> expected n.frac /.nat (n.= expected)))) (do [! random.monad] - [expected (# ! each (i.% +1,000,000) random.int)] + [expected (at ! each (i.% +1,000,000) random.int)] (_.coverage [/.int] (|> expected i.frac /.int (i.= expected)))) (do [! random.monad] - [expected (# ! each (|>> (i64.left_shifted 52) .rev) - random.nat)] + [expected (at ! each (|>> (i64.left_shifted 52) .rev) + random.nat)] (_.coverage [/.rev] (|> expected r.frac /.rev (r.= expected)))) )) @@ -141,7 +141,7 @@ (all _.and (do [! random.monad] [.let [~= (/.approximately? ..margin_of_error)] - angle (|> random.safe_frac (# ! each (/.* /.tau)))] + angle (|> random.safe_frac (at ! each (/.* /.tau)))] (all _.and (_.coverage [/.sin /.asin] (trigonometric_symmetry /.sin /.asin angle)) @@ -165,7 +165,7 @@ (~= (/./ +2.0 /.tau) /.pi)) )) (do [! random.monad] - [sample (|> random.safe_frac (# ! each (/.* +1000.0)))] + [sample (|> random.safe_frac (at ! each (/.* +1000.0)))] (all _.and (_.coverage [/.ceil] (let [ceil'd (/.ceil sample)] @@ -195,8 +195,8 @@ )) (do [! random.monad] [.let [~= (/.approximately? ..margin_of_error)] - sample (# ! each (/.* +10.0) random.safe_frac) - power (# ! each (|>> (n.% 10) ++ n.frac) random.nat)] + sample (at ! each (/.* +10.0) random.safe_frac) + power (at ! each (|>> (n.% 10) ++ n.frac) random.nat)] (all _.and (_.coverage [/.exp /.log] (|> sample /.exp /.log (/.approximately? +0.000000000000001 sample))) @@ -211,9 +211,9 @@ )) (do [! random.monad] [.let [~= (/.approximately? ..margin_of_error)] - angle (# ! each (/.* /.tau) random.safe_frac) - sample (# ! each /.abs random.safe_frac) - big (# ! each (/.* +1,000,000,000.00) random.safe_frac)] + angle (at ! each (/.* /.tau) random.safe_frac) + sample (at ! each /.abs random.safe_frac) + big (at ! each (/.* +1,000,000,000.00) random.safe_frac)] (template.let [(odd! <function>) [(_.coverage [<function>] (~= (/.opposite (<function> angle)) @@ -241,8 +241,8 @@ (inverse! /.atanh /.acoth big) ))) (do [! random.monad] - [x (# ! each (|>> (/.* +10.0) /.abs) random.safe_frac) - y (# ! each (|>> (/.* +10.0) /.abs) random.safe_frac)] + [x (at ! each (|>> (/.* +10.0) /.abs) random.safe_frac) + y (at ! each (|>> (/.* +10.0) /.abs) random.safe_frac)] (_.coverage [/.hypotenuse] (let [h (/.hypotenuse x y)] (and (/.>= x h) @@ -250,8 +250,8 @@ (do [! random.monad] [.let [~= (/.approximately? ..margin_of_error) tau/4 (/./ +4.0 /.tau)] - x (# ! each (/.* tau/4) random.safe_frac) - y (# ! each (/.* tau/4) random.safe_frac)] + x (at ! each (/.* tau/4) random.safe_frac) + y (at ! each (/.* tau/4) random.safe_frac)] (_.coverage [/.atan_2] (let [expected (/.atan_2 x y) actual (if (/.> +0.0 x) @@ -264,7 +264,7 @@ (~= (/.opposite tau/4) (/.atan_2 +0.0 (/.opposite (/.abs y)))) (/.not_a_number? (/.atan_2 +0.0 +0.0)))))) (do [! random.monad] - [of (# ! each (|>> (n.% 10) ++) random.nat)] + [of (at ! each (|>> (n.% 10) ++) random.nat)] (_.coverage [/.factorial] (and (n.= 1 (/.factorial 0)) (|> (/.factorial of) (n.% of) (n.= 0))))) diff --git a/stdlib/source/test/lux/math/number/i16.lux b/stdlib/source/test/lux/math/number/i16.lux index 65f1c45c0..d8ee85c4a 100644 --- a/stdlib/source/test/lux/math/number/i16.lux +++ b/stdlib/source/test/lux/math/number/i16.lux @@ -16,7 +16,7 @@ (def: .public random (Random /.I16) - (# random.functor each /.i16 random.i64)) + (at random.functor each /.i16 random.i64)) (def: .public test Test @@ -27,12 +27,12 @@ //i64.mask .int ++)] - expected (# ! each (i.% limit) random.int)] + expected (at ! each (i.% limit) random.int)] (all _.and (_.for [/.equivalence] ($equivalence.spec /.equivalence ..random)) (_.coverage [/.i16 /.i64 /.width] (let [actual (|> expected .i64 /.i16 /.i64)] - (# //i64.equivalence = expected actual))) + (at //i64.equivalence = expected actual))) )))) diff --git a/stdlib/source/test/lux/math/number/i32.lux b/stdlib/source/test/lux/math/number/i32.lux index 687621561..189e79b06 100644 --- a/stdlib/source/test/lux/math/number/i32.lux +++ b/stdlib/source/test/lux/math/number/i32.lux @@ -16,7 +16,7 @@ (def: .public random (Random /.I32) - (# random.functor each /.i32 random.i64)) + (at random.functor each /.i32 random.i64)) (def: .public test Test @@ -27,12 +27,12 @@ //i64.mask .int ++)] - expected (# ! each (i.% limit) random.int)] + expected (at ! each (i.% limit) random.int)] (all _.and (_.for [/.equivalence] ($equivalence.spec /.equivalence ..random)) (_.coverage [/.i32 /.i64 /.width] (let [actual (|> expected .i64 /.i32 /.i64)] - (# //i64.equivalence = expected actual))) + (at //i64.equivalence = expected actual))) )))) diff --git a/stdlib/source/test/lux/math/number/i64.lux b/stdlib/source/test/lux/math/number/i64.lux index 550d6f03d..75324e869 100644 --- a/stdlib/source/test/lux/math/number/i64.lux +++ b/stdlib/source/test/lux/math/number/i64.lux @@ -22,7 +22,7 @@ Test (do [! random.monad] [pattern random.nat - idx (# ! each (n.% /.width) random.nat)] + idx (at ! each (n.% /.width) random.nat)] (all _.and (_.coverage [/.one? /.one] (if (/.one? idx pattern) @@ -48,7 +48,7 @@ [pattern random.nat] (all _.and (do ! - [idx (# ! each (|>> (n.% (-- /.width)) ++) random.nat)] + [idx (at ! each (|>> (n.% (-- /.width)) ++) random.nat)] (_.coverage [/.left_shifted /.right_shifted] (let [nullity! (and (/#= pattern (/.left_shifted 0 pattern)) @@ -74,7 +74,7 @@ (<| (_.for [/.Mask]) (do [! random.monad] [pattern random.nat - idx (# ! each (n.% /.width) random.nat) + idx (at ! each (n.% /.width) random.nat) signed random.int] (all _.and (_.coverage [/.sign] @@ -98,9 +98,9 @@ empty! full!))) (do ! - [size (# ! each (n.% /.width) random.nat) + [size (at ! each (n.% /.width) random.nat) .let [spare (n.- size /.width)] - offset (# ! each (n.% spare) random.nat)] + offset (at ! each (n.% spare) random.nat)] (_.coverage [/.region] (case size 0 (/#= /.false (/.region offset size)) @@ -122,7 +122,7 @@ Test (_.for [/.Sub] (do [! random.monad] - [size (# ! each (n.% /.width) random.nat)] + [size (at ! each (n.% /.width) random.nat)] (case (/.sub size) {.#None} (_.coverage [/.sub] @@ -130,19 +130,19 @@ {.#Some sub} (do [! random.monad] - [.let [limit (|> (-- (# sub bits)) + [.let [limit (|> (-- (at sub bits)) /.mask .int ++)] - expected (# ! each (i.% limit) random.int) + expected (at ! each (i.% limit) random.int) .let [random (is (All (_ size) (-> (-> I64 (I64 size)) (Random (I64 size)))) (function (_ narrow) - (# random.functor each narrow random.i64)))]] + (at random.functor each narrow random.i64)))]] (all _.and - ($equivalence.spec (# sub sub_equivalence) (random (# sub narrow))) + ($equivalence.spec (at sub sub_equivalence) (random (at sub narrow))) (_.coverage [/.sub] - (let [actual (|> expected .i64 (# sub narrow) (# sub wide))] + (let [actual (|> expected .i64 (at sub narrow) (at sub wide))] (/#= expected actual))) )))))) @@ -165,7 +165,7 @@ (_.for [.I64]) (do [! random.monad] [pattern random.nat - idx (# ! each (n.% /.width) random.nat)] + idx (at ! each (n.% /.width) random.nat)] (all _.and (_.coverage [/.width /.bits_per_byte /.bytes_per_i64] (and (n.= /.bytes_per_i64 diff --git a/stdlib/source/test/lux/math/number/i8.lux b/stdlib/source/test/lux/math/number/i8.lux index 9f45a2e8c..edf503bf9 100644 --- a/stdlib/source/test/lux/math/number/i8.lux +++ b/stdlib/source/test/lux/math/number/i8.lux @@ -16,7 +16,7 @@ (def: .public random (Random /.I8) - (# random.functor each /.i8 random.i64)) + (at random.functor each /.i8 random.i64)) (def: .public test Test @@ -27,12 +27,12 @@ //i64.mask .int ++)] - expected (# ! each (i.% limit) random.int)] + expected (at ! each (i.% limit) random.int)] (all _.and (_.for [/.equivalence] ($equivalence.spec /.equivalence ..random)) (_.coverage [/.i8 /.i64 /.width] (let [actual (|> expected .i64 /.i8 /.i64)] - (# //i64.equivalence = expected actual))) + (at //i64.equivalence = expected actual))) )))) diff --git a/stdlib/source/test/lux/math/number/int.lux b/stdlib/source/test/lux/math/number/int.lux index 1509a65fc..76ed060da 100644 --- a/stdlib/source/test/lux/math/number/int.lux +++ b/stdlib/source/test/lux/math/number/int.lux @@ -167,7 +167,7 @@ )) (do [! random.monad] [.let [random (|> random.int - (# ! each (/.% +1,000)) + (at ! each (/.% +1,000)) (random.only (|>> (/.= +0) not)))] left random right random] @@ -208,14 +208,14 @@ (and subtraction! inverse!)))) (do [! random.monad] - [expected (# ! each (/.% +1,000,000) random.int) + [expected (at ! each (/.% +1,000,000) random.int) sample random.int] (_.coverage [/.frac] (and (|> expected /.frac f.int (/.= expected)) (f.number? (/.frac sample))))) (do [! random.monad] [pattern random.int - idx (# ! each (n.% i64.width) random.nat)] + idx (at ! each (n.% i64.width) random.nat)] (_.coverage [/.right_shifted] (let [nullity! (/.= pattern (/.right_shifted 0 pattern)) diff --git a/stdlib/source/test/lux/math/number/nat.lux b/stdlib/source/test/lux/math/number/nat.lux index 733b6445e..54471e9b3 100644 --- a/stdlib/source/test/lux/math/number/nat.lux +++ b/stdlib/source/test/lux/math/number/nat.lux @@ -104,7 +104,7 @@ (/.= rem (/.% left right))))) )) (do [! random.monad] - [.let [random (# ! each (|>> (/.% 1,000) ++) random.nat)] + [.let [random (at ! each (|>> (/.% 1,000) ++) random.nat)] left random right random] (all _.and @@ -121,7 +121,7 @@ (/.= 0 (/.% right lcm))))) )) (do [! random.monad] - [expected (# ! each (/.% 1,000,000) random.nat) + [expected (at ! each (/.% 1,000,000) random.nat) sample random.nat] (_.coverage [/.frac] (and (|> expected /.frac f.nat (/.= expected)) diff --git a/stdlib/source/test/lux/math/number/ratio.lux b/stdlib/source/test/lux/math/number/ratio.lux index fe01953dc..7b8d252ef 100644 --- a/stdlib/source/test/lux/math/number/ratio.lux +++ b/stdlib/source/test/lux/math/number/ratio.lux @@ -22,9 +22,9 @@ (def: part (Random Nat) - (# random.monad each - (|>> (n.% 1,000,000) (n.max 1)) - random.nat)) + (at random.monad each + (|>> (n.% 1,000,000) (n.max 1)) + random.nat)) (def: .public random (Random /.Ratio) diff --git a/stdlib/source/test/lux/math/number/rev.lux b/stdlib/source/test/lux/math/number/rev.lux index 82b16e725..72d03d335 100644 --- a/stdlib/source/test/lux/math/number/rev.lux +++ b/stdlib/source/test/lux/math/number/rev.lux @@ -89,27 +89,27 @@ (and (/.< left (/.* left right)) (/.< right (/.* left right))))) (do [! random.monad] - [.let [dividend (# ! each (i64.and (hex "FFFF")) - random.rev) - divisor (# ! each (|>> (i64.and (hex "F")) - (i64.or (hex "1")) - (i64.right_rotated 8) - .rev) - random.nat)] + [.let [dividend (at ! each (i64.and (hex "FFFF")) + random.rev) + divisor (at ! each (|>> (i64.and (hex "F")) + (i64.or (hex "1")) + (i64.right_rotated 8) + .rev) + random.nat)] dividend (random.only (/.> .0) dividend) divisor/0 divisor divisor/1 (random.only (|>> (/.= divisor/0) not) divisor) - scale (# ! each (|>> (n.% 10) ++) - random.nat)] + scale (at ! each (|>> (n.% 10) ++) + random.nat)] (all _.and (_.coverage [/./] (bit#= (/.< divisor/0 divisor/1) (/.> (/./ divisor/0 dividend) (/./ divisor/1 dividend)))) (_.coverage [/.%] - (# i64.equivalence = - (.i64 (n.% (.nat divisor/0) (.nat dividend))) - (.i64 (/.% divisor/0 dividend)))) + (at i64.equivalence = + (.i64 (n.% (.nat divisor/0) (.nat dividend))) + (.i64 (/.% divisor/0 dividend)))) (_.coverage [/.up /.down] (let [symmetry! (|> dividend @@ -156,8 +156,8 @@ (/.= (/.reciprocal sample) (|> sample /.reciprocal .nat /.reciprocal .nat /.reciprocal)))) (do [! random.monad] - [expected (# ! each (|>> f.abs (f.% +1.0)) - random.safe_frac) + [expected (at ! each (|>> f.abs (f.% +1.0)) + random.safe_frac) sample random.rev] (_.coverage [/.frac] (and (|> expected f.rev /.frac (f.= expected)) |