From f59d42c7a9ad26014c9ff893d53336a0e5d8c7d3 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 13 May 2018 01:13:10 -0400 Subject: - Re-named ".../eq" modules to ".../equality". - Other minor improvements. --- stdlib/test/test/lux/control/eq.lux | 19 ------ stdlib/test/test/lux/control/equality.lux | 19 ++++++ stdlib/test/test/lux/control/parser.lux | 2 +- stdlib/test/test/lux/data/coll/bits.lux | 2 +- .../test/test/lux/data/coll/dictionary/ordered.lux | 2 +- .../test/lux/data/coll/dictionary/unordered.lux | 2 +- stdlib/test/test/lux/data/format/json.lux | 6 +- stdlib/test/test/lux/macro/poly/eq.lux | 70 ---------------------- stdlib/test/test/lux/macro/poly/equality.lux | 70 ++++++++++++++++++++++ stdlib/test/test/lux/macro/poly/functor.lux | 2 +- stdlib/test/test/lux/macro/syntax.lux | 2 +- stdlib/test/test/lux/type/implicit.lux | 2 +- stdlib/test/test/lux/world/blob.lux | 2 +- stdlib/test/tests.lux | 2 +- 14 files changed, 101 insertions(+), 101 deletions(-) delete mode 100644 stdlib/test/test/lux/control/eq.lux create mode 100644 stdlib/test/test/lux/control/equality.lux delete mode 100644 stdlib/test/test/lux/macro/poly/eq.lux create mode 100644 stdlib/test/test/lux/macro/poly/equality.lux (limited to 'stdlib/test') diff --git a/stdlib/test/test/lux/control/eq.lux b/stdlib/test/test/lux/control/eq.lux deleted file mode 100644 index c63973079..000000000 --- a/stdlib/test/test/lux/control/eq.lux +++ /dev/null @@ -1,19 +0,0 @@ -(.module: - lux - (lux (control ["/" eq] - [monad #+ do]) - (math ["r" random]) - test)) - -(def: #export (spec Eq generator) - (All [a] (-> (/.Eq a) (r.Random a) Test)) - (do r.Monad - [sample generator - another generator] - ($_ seq - (test "Equality is reflexive." - (:: Eq = sample sample)) - (test "Equality is symmetric." - (if (:: Eq = sample another) - (:: Eq = another sample) - true))))) diff --git a/stdlib/test/test/lux/control/equality.lux b/stdlib/test/test/lux/control/equality.lux new file mode 100644 index 000000000..5139b41ea --- /dev/null +++ b/stdlib/test/test/lux/control/equality.lux @@ -0,0 +1,19 @@ +(.module: + lux + (lux (control ["/" equality] + [monad #+ do]) + (math ["r" random]) + test)) + +(def: #export (spec Eq generator) + (All [a] (-> (/.Eq a) (r.Random a) Test)) + (do r.Monad + [sample generator + another generator] + ($_ seq + (test "Equality is reflexive." + (:: Eq = sample sample)) + (test "Equality is symmetric." + (if (:: Eq = sample another) + (:: Eq = another sample) + true))))) diff --git a/stdlib/test/test/lux/control/parser.lux b/stdlib/test/test/lux/control/parser.lux index c295463cf..bc26444ce 100644 --- a/stdlib/test/test/lux/control/parser.lux +++ b/stdlib/test/test/lux/control/parser.lux @@ -2,7 +2,7 @@ lux (lux [io] (control ["M" monad #+ do Monad] - [eq #+ Eq] + [equality #+ Eq] ["&" parser] pipe) (data [text "Text/" Monoid] diff --git a/stdlib/test/test/lux/data/coll/bits.lux b/stdlib/test/test/lux/data/coll/bits.lux index f416f9866..a5141034c 100644 --- a/stdlib/test/test/lux/data/coll/bits.lux +++ b/stdlib/test/test/lux/data/coll/bits.lux @@ -5,7 +5,7 @@ (data (coll ["/" bits])) ["r" math/random]) lux/test - (test (lux (control ["_." eq])))) + (test (lux (control ["_eq" equality])))) (def: (size min max) (-> Nat Nat (r.Random Nat)) diff --git a/stdlib/test/test/lux/data/coll/dictionary/ordered.lux b/stdlib/test/test/lux/data/coll/dictionary/ordered.lux index 041e27484..a373f6107 100644 --- a/stdlib/test/test/lux/data/coll/dictionary/ordered.lux +++ b/stdlib/test/test/lux/data/coll/dictionary/ordered.lux @@ -2,7 +2,7 @@ lux (lux [io] (control [monad #+ do Monad] - [eq #+ Eq]) + [equality #+ Eq]) (data [product] [number] (coll (set ["s" unordered]) diff --git a/stdlib/test/test/lux/data/coll/dictionary/unordered.lux b/stdlib/test/test/lux/data/coll/dictionary/unordered.lux index f0224a015..93b83dc7b 100644 --- a/stdlib/test/test/lux/data/coll/dictionary/unordered.lux +++ b/stdlib/test/test/lux/data/coll/dictionary/unordered.lux @@ -2,7 +2,7 @@ lux (lux [io] (control [monad #+ do Monad] - [eq]) + ["eq" equality]) (data [text] text/format [number] diff --git a/stdlib/test/test/lux/data/format/json.lux b/stdlib/test/test/lux/data/format/json.lux index e2781d2a5..43b0851c0 100644 --- a/stdlib/test/test/lux/data/format/json.lux +++ b/stdlib/test/test/lux/data/format/json.lux @@ -3,7 +3,7 @@ (lux [io] (control [monad #+ do Monad] codec - [eq #+ Eq] + [equality #+ Eq] pipe ["p" parser]) (data [text] @@ -20,7 +20,7 @@ (macro [code] [syntax #+ syntax:] [poly #+ derived:] - [poly/eq] + [poly/equality] [poly/json]) (type [unit]) ["r" math/random] @@ -97,7 +97,7 @@ (r.alt r.frac (r.seq r.frac gen-recursive))))) -(derived: (poly/eq.Eq Recursive)) +(derived: (poly/equality.Eq Recursive)) (def: qty (All [unit] (r.Random (unit.Qty unit))) diff --git a/stdlib/test/test/lux/macro/poly/eq.lux b/stdlib/test/test/lux/macro/poly/eq.lux deleted file mode 100644 index d22475b11..000000000 --- a/stdlib/test/test/lux/macro/poly/eq.lux +++ /dev/null @@ -1,70 +0,0 @@ -(.module: - lux - (lux [io] - (control [monad #+ do Monad] - [eq #+ Eq]) - (data text/format - [bool] - [number "int/" Number] - [text] - [maybe] - (coll [list])) - ["r" math/random] - [macro] - (macro [poly #+ derived:] - ["&" poly/eq])) - lux/test) - -## [Utils] -(type: Variant - (#Case0 Bool) - (#Case1 Int) - (#Case2 Frac)) - -(type: #rec Recursive - (#Number Frac) - (#Addition Frac Recursive)) - -(type: Record - {#bool Bool - #int Int - #frac Frac - #text Text - #maybe (Maybe Int) - #list (List Int) - #variant Variant - #tuple [Int Frac Text] - #recursive Recursive}) - -(def: gen-recursive - (r.Random Recursive) - (r.rec (function (_ gen-recursive) - (r.alt r.frac - (r.seq r.frac gen-recursive))))) - -(def: gen-record - (r.Random Record) - (do r.Monad - [size (:: @ map (n/% +2) r.nat) - #let [gen-int (|> r.int (:: @ map (|>> int/abs (i/% 1_000_000))))]] - ($_ r.seq - r.bool - gen-int - r.frac - (r.text size) - (r.maybe gen-int) - (r.list size gen-int) - ($_ r.alt r.bool gen-int r.frac) - ($_ r.seq gen-int r.frac (r.text size)) - gen-recursive))) - -(derived: (&.Eq Record)) - -## [Tests] -(context: "Eq polytypism" - (<| (times +100) - (do @ - [sample gen-record - #let [(^open "&/") Eq]] - (test "Every instance equals itself." - (&/= sample sample))))) diff --git a/stdlib/test/test/lux/macro/poly/equality.lux b/stdlib/test/test/lux/macro/poly/equality.lux new file mode 100644 index 000000000..beb203bcb --- /dev/null +++ b/stdlib/test/test/lux/macro/poly/equality.lux @@ -0,0 +1,70 @@ +(.module: + lux + (lux [io] + (control [monad #+ do Monad] + [equality #+ Eq]) + (data text/format + [bool] + [number "int/" Number] + [text] + [maybe] + (coll [list])) + ["r" math/random] + [macro] + (macro [poly #+ derived:] + ["&" poly/equality])) + lux/test) + +## [Utils] +(type: Variant + (#Case0 Bool) + (#Case1 Int) + (#Case2 Frac)) + +(type: #rec Recursive + (#Number Frac) + (#Addition Frac Recursive)) + +(type: Record + {#bool Bool + #int Int + #frac Frac + #text Text + #maybe (Maybe Int) + #list (List Int) + #variant Variant + #tuple [Int Frac Text] + #recursive Recursive}) + +(def: gen-recursive + (r.Random Recursive) + (r.rec (function (_ gen-recursive) + (r.alt r.frac + (r.seq r.frac gen-recursive))))) + +(def: gen-record + (r.Random Record) + (do r.Monad + [size (:: @ map (n/% +2) r.nat) + #let [gen-int (|> r.int (:: @ map (|>> int/abs (i/% 1_000_000))))]] + ($_ r.seq + r.bool + gen-int + r.frac + (r.text size) + (r.maybe gen-int) + (r.list size gen-int) + ($_ r.alt r.bool gen-int r.frac) + ($_ r.seq gen-int r.frac (r.text size)) + gen-recursive))) + +(derived: (&.Eq Record)) + +## [Tests] +(context: "Eq polytypism" + (<| (times +100) + (do @ + [sample gen-record + #let [(^open "&/") Eq]] + (test "Every instance equals itself." + (&/= sample sample))))) diff --git a/stdlib/test/test/lux/macro/poly/functor.lux b/stdlib/test/test/lux/macro/poly/functor.lux index 3cb6653a5..86c3eca7f 100644 --- a/stdlib/test/test/lux/macro/poly/functor.lux +++ b/stdlib/test/test/lux/macro/poly/functor.lux @@ -3,7 +3,7 @@ (lux [io] (control [monad #+ do Monad] [functor] - [eq #+ Eq] + [equality #+ Eq] [state]) (data text/format [bool] diff --git a/stdlib/test/test/lux/macro/syntax.lux b/stdlib/test/test/lux/macro/syntax.lux index 5c5ea835f..ba45ff6e4 100644 --- a/stdlib/test/test/lux/macro/syntax.lux +++ b/stdlib/test/test/lux/macro/syntax.lux @@ -2,7 +2,7 @@ lux (lux [io] (control [monad #+ do Monad] - [eq #+ Eq] + [equality #+ Eq] ["p" parser]) (data [text "Text/" Monoid] text/format diff --git a/stdlib/test/test/lux/type/implicit.lux b/stdlib/test/test/lux/type/implicit.lux index c07067b3e..a5af06c5d 100644 --- a/stdlib/test/test/lux/type/implicit.lux +++ b/stdlib/test/test/lux/type/implicit.lux @@ -3,7 +3,7 @@ (lux [io] (control [monad #+ do Monad] functor - [eq]) + [equality]) (data [number] [bool "bool/" Eq] (coll [list])) diff --git a/stdlib/test/test/lux/world/blob.lux b/stdlib/test/test/lux/world/blob.lux index 1093f302f..e1c77552b 100644 --- a/stdlib/test/test/lux/world/blob.lux +++ b/stdlib/test/test/lux/world/blob.lux @@ -10,7 +10,7 @@ (world ["/" blob]) ["r" math/random]) lux/test - (test (lux (control ["_." eq])))) + (test (lux (control ["_eq" equality])))) (def: (succeed result) (-> (e.Error Bool) Bool) diff --git a/stdlib/test/tests.lux b/stdlib/test/tests.lux index 6a429093b..ce4113317 100644 --- a/stdlib/test/tests.lux +++ b/stdlib/test/tests.lux @@ -66,7 +66,7 @@ ["_." fuzzy])) (macro ["_." code] ["_." syntax] - (poly ["poly_." eq] + (poly ["poly_." equality] ["poly_." functor])) (type ["_." implicit] ["_." resource] -- cgit v1.2.3