diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/data/collection/set/ordered.lux | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/stdlib/source/test/lux/data/collection/set/ordered.lux b/stdlib/source/test/lux/data/collection/set/ordered.lux index 25c645651..6c0e75b3d 100644 --- a/stdlib/source/test/lux/data/collection/set/ordered.lux +++ b/stdlib/source/test/lux/data/collection/set/ordered.lux @@ -23,7 +23,7 @@ (random.Random Nat) (\ random.monad map (n.% 100) random.nat)) -(def: #export (random size &order gen-value) +(def: #export (random size &order gen_value) (All [a] (-> Nat (Order a) (Random a) (Random (Set a)))) (case size 0 @@ -31,9 +31,9 @@ _ (do random.monad - [partial (random (dec size) &order gen-value) + [partial (random (dec size) &order gen_value) value (random.filter (|>> (/.member? partial) not) - gen-value)] + gen_value)] (wrap (/.add value partial))))) (def: #export test @@ -44,13 +44,13 @@ [sizeL ..size sizeR ..size usetL (random.set n.hash sizeL random.nat) - non-memberL (random.filter (|>> (//.member? usetL) not) + non_memberL (random.filter (|>> (//.member? usetL) not) random.nat) - #let [listL (//.to-list usetL)] - listR (|> (random.set n.hash sizeR random.nat) (\ ! map //.to-list)) + #let [listL (//.to_list usetL)] + listR (|> (random.set n.hash sizeR random.nat) (\ ! map //.to_list)) #let [(^open "/\.") /.equivalence - setL (/.from-list n.order listL) - setR (/.from-list n.order listR) + setL (/.from_list n.order listL) + setR (/.from_list n.order listR) empty (/.new n.order)]] (`` ($_ _.and (_.for [/.equivalence] @@ -63,19 +63,19 @@ (/.empty? setL))) (_.cover [/.new] (/.empty? (/.new n.order))) - (_.cover [/.to-list] + (_.cover [/.to_list] (\ (list.equivalence n.equivalence) = - (/.to-list (/.from-list n.order listL)) + (/.to_list (/.from_list n.order listL)) (list.sort (\ n.order <) listL))) - (_.cover [/.from-list] + (_.cover [/.from_list] (|> setL - /.to-list (/.from-list n.order) + /.to_list (/.from_list n.order) (/\= setL))) (~~ (template [<coverage> <comparison>] [(_.cover [<coverage>] (case (<coverage> setL) (#.Some value) - (|> setL /.to-list (list.every? (<comparison> value))) + (|> setL /.to_list (list.every? (<comparison> value))) #.None (/.empty? setL)))] @@ -84,23 +84,23 @@ [/.max n.<=] )) (_.cover [/.member?] - (let [members-are-identified! - (list.every? (/.member? setL) (/.to-list setL)) + (let [members_are_identified! + (list.every? (/.member? setL) (/.to_list setL)) - non-members-are-not-identified! - (not (/.member? setL non-memberL))] - (and members-are-identified! - non-members-are-not-identified!))) + non_members_are_not_identified! + (not (/.member? setL non_memberL))] + (and members_are_identified! + non_members_are_not_identified!))) (_.cover [/.add] - (let [setL+ (/.add non-memberL setL)] - (and (not (/.member? setL non-memberL)) - (/.member? setL+ non-memberL) + (let [setL+ (/.add non_memberL setL)] + (and (not (/.member? setL non_memberL)) + (/.member? setL+ non_memberL) (n.= (inc (/.size setL)) (/.size setL+))))) (_.cover [/.remove] (|> setL - (/.add non-memberL) - (/.remove non-memberL) + (/.add non_memberL) + (/.remove non_memberL) (\ /.equivalence = setL))) (_.cover [/.sub?] (let [self! @@ -164,7 +164,7 @@ difference! (not (list.any? (/.member? (/.difference setL setR)) - (/.to-list setL))) + (/.to_list setL))) idempotence! (\ /.equivalence = |