diff options
Diffstat (limited to 'stdlib/source/test/lux/math')
-rw-r--r-- | stdlib/source/test/lux/math/logic/fuzzy.lux | 8 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/modular.lux | 6 | ||||
-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 | 6 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/frac.lux | 34 | ||||
-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 | 2 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/rev.lux | 10 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/random.lux | 4 |
15 files changed, 65 insertions, 65 deletions
diff --git a/stdlib/source/test/lux/math/logic/fuzzy.lux b/stdlib/source/test/lux/math/logic/fuzzy.lux index 345578ead..39d67239b 100644 --- a/stdlib/source/test/lux/math/logic/fuzzy.lux +++ b/stdlib/source/test/lux/math/logic/fuzzy.lux @@ -40,9 +40,9 @@ (do [! random.monad] [sample random.rev - threshold_0 (at ! each (r.% .5) + threshold_0 (of ! each (r.% .5) random.rev) - threshold_1 (at ! each (|>> (r.% .5) (r.+ .5)) + threshold_1 (of ! each (|>> (r.% .5) (r.+ .5)) random.rev) .let [bottom (r.min threshold_0 threshold_1) @@ -90,7 +90,7 @@ [bottom middle_bottom middle_top top] (|> random.rev (random.set r.hash 4) - (at ! each (|>> set.list (list.sorted r.<))) + (of ! each (|>> set.list (list.sorted r.<))) (random.one (function (_ thresholds) (when thresholds (list threshold_0 threshold_1 threshold_2 threshold_3) @@ -174,7 +174,7 @@ [bottom middle_bottom middle_top top] (|> random.rev (random.set r.hash 4) - (at ! each (|>> set.list (list.sorted r.<))) + (of ! each (|>> set.list (list.sorted r.<))) (random.one (function (_ thresholds) (when thresholds (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 44610bd3c..686977544 100644 --- a/stdlib/source/test/lux/math/modular.lux +++ b/stdlib/source/test/lux/math/modular.lux @@ -33,7 +33,7 @@ (def .public (random modulus) (All (_ %) (-> (//.Modulus %) (Random (/.Mod %)))) - (at random.monad each + (of random.monad each (/.modular modulus) random.int)) @@ -67,8 +67,8 @@ (_.coverage [/.incorrect_modulus] (when (|> param - (at (/.codec param::%) encoded) - (at (/.codec subject::%) decoded)) + (of (/.codec param::%) encoded) + (of (/.codec subject::%) decoded)) {try.#Failure error} (exception.match? /.incorrect_modulus error) diff --git a/stdlib/source/test/lux/math/modulus.lux b/stdlib/source/test/lux/math/modulus.lux index 49c406b9b..b09c71a44 100644 --- a/stdlib/source/test/lux/math/modulus.lux +++ b/stdlib/source/test/lux/math/modulus.lux @@ -30,7 +30,7 @@ (def .public (random range) (Ex (_ %) (-> Int (Random (/.Modulus %)))) (|> random.int - (at random.monad each (i.% range)) + (of 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 536448d48..18ec4112b 100644 --- a/stdlib/source/test/lux/math/number.lux +++ b/stdlib/source/test/lux/math/number.lux @@ -35,7 +35,7 @@ (all _.and (_.coverage [/.bin] (`` (and (,, (with_template [<=> <codec> <number>] - [(when (at <codec> decoded (..clean_commas <number>)) + [(when (of <codec> decoded (..clean_commas <number>)) {try.#Success actual} (<=> (/.bin <number>) actual) @@ -54,7 +54,7 @@ ))))) (_.coverage [/.oct] (`` (and (,, (with_template [<=> <codec> <number>] - [(when (at <codec> decoded (..clean_commas <number>)) + [(when (of <codec> decoded (..clean_commas <number>)) {try.#Success actual} (<=> (/.oct <number>) actual) @@ -73,7 +73,7 @@ ))))) (_.coverage [/.hex] (`` (and (,, (with_template [<=> <codec> <number>] - [(when (at <codec> decoded (..clean_commas <number>)) + [(when (of <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 501d01cd0..fd11abd80 100644 --- a/stdlib/source/test/lux/math/number/complex.lux +++ b/stdlib/source/test/lux/math/number/complex.lux @@ -28,7 +28,7 @@ (def dimension (Random Frac) (do [! random.monad] - [factor (|> random.nat (at ! each (|>> (n.% 1000) (n.max 1)))) + [factor (|> random.nat (of ! each (|>> (n.% 1000) (n.max 1)))) measure (|> random.safe_frac (random.only (f.> +0.0)))] (in (f.* (|> factor .int int.frac) measure)))) @@ -42,7 +42,7 @@ (def angle (Random /.Complex) - (at random.monad each + (of random.monad each (|>> (revised /.#real (f.% +1.0)) (revised /.#imaginary (f.% +1.0))) ..random)) @@ -260,7 +260,7 @@ Test (do [! random.monad] [sample ..random - degree (|> random.nat (at ! each (|>> (n.max 1) (n.% 5))))] + degree (|> random.nat (of ! 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 673b04276..0e4f99ed6 100644 --- a/stdlib/source/test/lux/math/number/frac.lux +++ b/stdlib/source/test/lux/math/number/frac.lux @@ -32,7 +32,7 @@ (def random (Random Frac) - (at random.monad each (|>> (i.% +1,000,000) i.frac) random.int)) + (of random.monad each (|>> (i.% +1,000,000) i.frac) random.int)) (def constant Test @@ -58,7 +58,7 @@ Test (do [! random.monad] [sample ..random - shift (at ! each /.abs ..random)] + shift (of ! each /.abs ..random)] (all _.and (_.coverage [/.negative?] (bit#= (/.negative? sample) @@ -83,15 +83,15 @@ Test (all _.and (do [! random.monad] - [expected (at ! each (n.% 1,000,000) random.nat)] + [expected (of ! each (n.% 1,000,000) random.nat)] (_.coverage [/.nat] (|> expected n.frac /.nat (n.= expected)))) (do [! random.monad] - [expected (at ! each (i.% +1,000,000) random.int)] + [expected (of ! each (i.% +1,000,000) random.int)] (_.coverage [/.int] (|> expected i.frac /.int (i.= expected)))) (do [! random.monad] - [expected (at ! each (|>> (i64.left_shifted 52) .rev) + [expected (of ! each (|>> (i64.left_shifted 52) .rev) random.nat)] (_.coverage [/.rev] (|> expected r.frac /.rev (r.= expected)))) @@ -147,7 +147,7 @@ (all _.and (do [! random.monad] [.let [~= (/.approximately? ..margin_of_error)] - angle (|> random.safe_frac (at ! each (/.* /.tau)))] + angle (|> random.safe_frac (of ! each (/.* /.tau)))] (all _.and (_.coverage [/.sin /.asin] (trigonometric_symmetry /.sin /.asin angle)) @@ -171,7 +171,7 @@ (~= (/./ +2.0 /.tau) /.pi)) )) (do [! random.monad] - [sample (|> random.safe_frac (at ! each (/.* +1000.0)))] + [sample (|> random.safe_frac (of ! each (/.* +1000.0)))] (all _.and (_.coverage [/.ceil] (let [ceil'd (/.ceil sample)] @@ -201,8 +201,8 @@ )) (do [! random.monad] [.let [~= (/.approximately? ..margin_of_error)] - sample (at ! each (/.* +10.0) random.safe_frac) - power (at ! each (|>> (n.% 10) ++ n.frac) random.nat)] + sample (of ! each (/.* +10.0) random.safe_frac) + power (of ! each (|>> (n.% 10) ++ n.frac) random.nat)] (all _.and (_.coverage [/.exp /.log] (|> sample /.exp /.log (/.approximately? +0.000000000000001 sample))) @@ -217,9 +217,9 @@ )) (do [! random.monad] [.let [~= (/.approximately? ..margin_of_error)] - 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)] + angle (of ! each (/.* /.tau) random.safe_frac) + sample (of ! each /.abs random.safe_frac) + big (of ! each (/.* +1,000,000,000.00) random.safe_frac)] (template.let [(odd! <function>) [(_.coverage [<function>] (~= (/.opposite (<function> angle)) @@ -247,8 +247,8 @@ (inverse! /.atanh /.acoth big) ))) (do [! random.monad] - [x (at ! each (|>> (/.* +10.0) /.abs) random.safe_frac) - y (at ! each (|>> (/.* +10.0) /.abs) random.safe_frac)] + [x (of ! each (|>> (/.* +10.0) /.abs) random.safe_frac) + y (of ! each (|>> (/.* +10.0) /.abs) random.safe_frac)] (_.coverage [/.hypotenuse] (let [h (/.hypotenuse x y)] (and (/.>= x h) @@ -256,8 +256,8 @@ (do [! random.monad] [.let [~= (/.approximately? ..margin_of_error) tau/4 (/./ +4.0 /.tau)] - x (at ! each (/.* tau/4) random.safe_frac) - y (at ! each (/.* tau/4) random.safe_frac)] + x (of ! each (/.* tau/4) random.safe_frac) + y (of ! each (/.* tau/4) random.safe_frac)] (_.coverage [/.atan_2] (let [expected (/.atan_2 x y) actual (if (/.> +0.0 x) @@ -270,7 +270,7 @@ (~= (/.opposite tau/4) (/.atan_2 +0.0 (/.opposite (/.abs y)))) (/.not_a_number? (/.atan_2 +0.0 +0.0)))))) (do [! random.monad] - [of (at ! each (|>> (n.% 10) ++) random.nat)] + [of (of ! 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 6753d2496..529f64f4a 100644 --- a/stdlib/source/test/lux/math/number/i16.lux +++ b/stdlib/source/test/lux/math/number/i16.lux @@ -17,7 +17,7 @@ (def .public random (Random /.I16) - (at random.functor each /.i16 random.i64)) + (of random.functor each /.i16 random.i64)) (def .public test Test @@ -28,12 +28,12 @@ //i64.mask .int ++)] - expected (at ! each (i.% limit) random.int)] + expected (of ! each (i.% limit) random.int)] (all _.and (_.for [/.equivalence] ($equivalence.spec /.equivalence ..random)) (_.coverage [/.i16 /.i64 /.width] (let [actual (|> expected .i64 /.i16 /.i64)] - (at //i64.equivalence = expected actual))) + (of //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 0770f96cd..e3f00275c 100644 --- a/stdlib/source/test/lux/math/number/i32.lux +++ b/stdlib/source/test/lux/math/number/i32.lux @@ -17,7 +17,7 @@ (def .public random (Random /.I32) - (at random.functor each /.i32 random.i64)) + (of random.functor each /.i32 random.i64)) (def .public test Test @@ -28,12 +28,12 @@ //i64.mask .int ++)] - expected (at ! each (i.% limit) random.int)] + expected (of ! each (i.% limit) random.int)] (all _.and (_.for [/.equivalence] ($equivalence.spec /.equivalence ..random)) (_.coverage [/.i32 /.i64 /.width] (let [actual (|> expected .i64 /.i32 /.i64)] - (at //i64.equivalence = expected actual))) + (of //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 025c41346..95a19b447 100644 --- a/stdlib/source/test/lux/math/number/i64.lux +++ b/stdlib/source/test/lux/math/number/i64.lux @@ -23,7 +23,7 @@ Test (do [! random.monad] [pattern random.nat - idx (at ! each (n.% /.width) random.nat)] + idx (of ! each (n.% /.width) random.nat)] (all _.and (_.coverage [/.one? /.one] (if (/.one? idx pattern) @@ -49,7 +49,7 @@ [pattern random.nat] (all _.and (do ! - [idx (at ! each (|>> (n.% (-- /.width)) ++) random.nat)] + [idx (of ! each (|>> (n.% (-- /.width)) ++) random.nat)] (_.coverage [/.left_shifted /.right_shifted] (let [nullity! (and (/#= pattern (/.left_shifted 0 pattern)) @@ -75,7 +75,7 @@ (<| (_.for [/.Mask]) (do [! random.monad] [pattern random.nat - idx (at ! each (n.% /.width) random.nat) + idx (of ! each (n.% /.width) random.nat) signed random.int] (all _.and (_.coverage [/.sign] @@ -99,9 +99,9 @@ empty! full!))) (do ! - [size (at ! each (n.% /.width) random.nat) + [size (of ! each (n.% /.width) random.nat) .let [spare (n.- size /.width)] - offset (at ! each (n.% spare) random.nat)] + offset (of ! each (n.% spare) random.nat)] (_.coverage [/.region] (when size 0 (/#= /.false (/.region offset size)) @@ -123,7 +123,7 @@ Test (_.for [/.Sub] (do [! random.monad] - [size (at ! each (n.% /.width) random.nat)] + [size (of ! each (n.% /.width) random.nat)] (when (/.sub size) {.#None} (_.coverage [/.sub] @@ -131,19 +131,19 @@ {.#Some sub} (do [! random.monad] - [.let [limit (|> (-- (at sub bits)) + [.let [limit (|> (-- (of sub bits)) /.mask .int ++)] - expected (at ! each (i.% limit) random.int) + expected (of ! each (i.% limit) random.int) .let [random (is (All (_ size) (-> (-> I64 (I64 size)) (Random (I64 size)))) (function (_ narrow) - (at random.functor each narrow random.i64)))]] + (of random.functor each narrow random.i64)))]] (all _.and - ($equivalence.spec (at sub sub_equivalence) (random (at sub narrow))) + ($equivalence.spec (of sub sub_equivalence) (random (of sub narrow))) (_.coverage [/.sub] - (let [actual (|> expected .i64 (at sub narrow) (at sub wide))] + (let [actual (|> expected .i64 (of sub narrow) (of sub wide))] (/#= expected actual))) )))))) @@ -166,7 +166,7 @@ (_.for [.I64]) (do [! random.monad] [pattern random.nat - idx (at ! each (n.% /.width) random.nat)] + idx (of ! 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 f07c37aa4..67c29698e 100644 --- a/stdlib/source/test/lux/math/number/i8.lux +++ b/stdlib/source/test/lux/math/number/i8.lux @@ -17,7 +17,7 @@ (def .public random (Random /.I8) - (at random.functor each /.i8 random.i64)) + (of random.functor each /.i8 random.i64)) (def .public test Test @@ -28,12 +28,12 @@ //i64.mask .int ++)] - expected (at ! each (i.% limit) random.int)] + expected (of ! each (i.% limit) random.int)] (all _.and (_.for [/.equivalence] ($equivalence.spec /.equivalence ..random)) (_.coverage [/.i8 /.i64 /.width] (let [actual (|> expected .i64 /.i8 /.i64)] - (at //i64.equivalence = expected actual))) + (of //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 46c2739e3..6223d9316 100644 --- a/stdlib/source/test/lux/math/number/int.lux +++ b/stdlib/source/test/lux/math/number/int.lux @@ -172,7 +172,7 @@ )) (do [! random.monad] [.let [random (|> random.int - (at ! each (/.% +1,000)) + (of ! each (/.% +1,000)) (random.only (|>> (/.= +0) not)))] left random right random] @@ -213,14 +213,14 @@ (and subtraction! inverse!)))) (do [! random.monad] - [expected (at ! each (/.% +1,000,000) random.int) + [expected (of ! 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 (at ! each (n.% i64.width) random.nat)] + idx (of ! 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 aecbccf81..6cd7bafd5 100644 --- a/stdlib/source/test/lux/math/number/nat.lux +++ b/stdlib/source/test/lux/math/number/nat.lux @@ -109,7 +109,7 @@ (/.= rem (/.% left right))))) )) (do [! random.monad] - [.let [random (at ! each (|>> (/.% 1,000) ++) random.nat)] + [.let [random (of ! each (|>> (/.% 1,000) ++) random.nat)] left random right random] (all _.and @@ -126,7 +126,7 @@ (/.= 0 (/.% right lcm))))) )) (do [! random.monad] - [expected (at ! each (/.% 1,000,000) random.nat) + [expected (of ! 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 d5062806c..1392162c3 100644 --- a/stdlib/source/test/lux/math/number/ratio.lux +++ b/stdlib/source/test/lux/math/number/ratio.lux @@ -25,7 +25,7 @@ (def part (Random Nat) - (at random.monad each + (of random.monad each (|>> (n.% 1,000,000) (n.max 1)) random.nat)) diff --git a/stdlib/source/test/lux/math/number/rev.lux b/stdlib/source/test/lux/math/number/rev.lux index 724d0112a..80b5b4a5a 100644 --- a/stdlib/source/test/lux/math/number/rev.lux +++ b/stdlib/source/test/lux/math/number/rev.lux @@ -94,9 +94,9 @@ (and (/.< left (/.* left right)) (/.< right (/.* left right))))) (do [! random.monad] - [.let [dividend (at ! each (i64.and (hex "FFFF")) + [.let [dividend (of ! each (i64.and (hex "FFFF")) random.rev) - divisor (at ! each (|>> (i64.and (hex "F")) + divisor (of ! each (|>> (i64.and (hex "F")) (i64.or (hex "1")) (i64.right_rotated 8) .rev) @@ -105,14 +105,14 @@ divisor/0 divisor divisor/1 (random.only (|>> (/.= divisor/0) not) divisor) - scale (at ! each (|>> (n.% 10) ++) + scale (of ! each (|>> (n.% 10) ++) random.nat)] (all _.and (_.coverage [/./] (bit#= (/.< divisor/0 divisor/1) (/.> (/./ divisor/0 dividend) (/./ divisor/1 dividend)))) (_.coverage [/.%] - (at i64.equivalence = + (of i64.equivalence = (.i64 (n.% (.nat divisor/0) (.nat dividend))) (.i64 (/.% divisor/0 dividend)))) (_.coverage [/.up /.down] @@ -161,7 +161,7 @@ (/.= (/.reciprocal sample) (|> sample /.reciprocal .nat /.reciprocal .nat /.reciprocal)))) (do [! random.monad] - [expected (at ! each (|>> f.abs (f.% +1.0)) + [expected (of ! each (|>> f.abs (f.% +1.0)) random.safe_frac) sample random.rev] (_.coverage [/.frac] diff --git a/stdlib/source/test/lux/math/random.lux b/stdlib/source/test/lux/math/random.lux index d74b7fc6d..e559a9c85 100644 --- a/stdlib/source/test/lux/math/random.lux +++ b/stdlib/source/test/lux/math/random.lux @@ -51,7 +51,7 @@ (def injection (Injection Random) - (at /.monad in)) + (of /.monad in)) (def (comparison increase,seed) (-> [(I64 Any) (I64 Any)] (Comparison Random)) @@ -67,7 +67,7 @@ (All (_ a) (-> (Equivalence a) (Random a) (Random Bit))) (do /.monad [reference random - example (/.only (|>> (at equivalence = reference) not) + example (/.only (|>> (of equivalence = reference) not) random)] (in (not (same? reference example))))) |