diff options
author | Eduardo Julian | 2017-07-22 13:59:19 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-07-22 13:59:19 -0400 |
commit | 5824d2c5b09889c3b0314694c4069c234bd992cf (patch) | |
tree | 7889a2e43e6b441499dd038f16e5ad52678e4d5f /stdlib/test | |
parent | 899b1823b1b5cd5d2d9f29439238b92756d4e536 (diff) |
- Small refactorings and bug fixes.
Diffstat (limited to '')
-rw-r--r-- | stdlib/test/test/lux/data/coll/dict.lux | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/stdlib/test/test/lux/data/coll/dict.lux b/stdlib/test/test/lux/data/coll/dict.lux index 7d90e428d..a6934a78b 100644 --- a/stdlib/test/test/lux/data/coll/dict.lux +++ b/stdlib/test/test/lux/data/coll/dict.lux @@ -3,20 +3,20 @@ (lux [io] (control monad [eq]) - (data [text "Text/" Monoid<Text>] + (data [text] text/format [number] (coll ["&" dict] - [list "List/" Fold<List> Functor<List>])) - ["R" math/random]) + [list "L/" Fold<List> Functor<List>])) + ["r" math/random]) lux/test) (context: "Dictionaries." - [#let [capped-nat (:: R;Monad<Random> map (n.% +100) R;nat)] + [#let [capped-nat (:: r;Monad<Random> map (n.% +100) r;nat)] size capped-nat - dict (R;dict number;Hash<Nat> size R;nat capped-nat) - non-key (|> R;nat (R;filter (function [key] (not (&;contains? key dict))))) - test-val (|> R;nat (R;filter (function [val] (not (list;member? number;Eq<Nat> (&;values dict) val)))))] + dict (r;dict number;Hash<Nat> size r;nat capped-nat) + non-key (|> r;nat (r;filter (function [key] (not (&;contains? key dict))))) + test-val (|> r;nat (r;filter (function [val] (not (list;member? number;Eq<Nat> (&;values dict) val)))))] ($_ seq (test "Size function should correctly represent Dict size." (n.= size (&;size dict))) @@ -27,7 +27,7 @@ (not (&;empty? dict)))) (test "The functions 'entries', 'keys' and 'values' should be synchronized." - (:: (list;Eq<List> (eq;conj number;Eq<Nat> number;Eq<Nat>)) = + (:: (list;Eq<List> (eq;seq number;Eq<Nat> number;Eq<Nat>)) = (&;entries dict) (list;zip2 (&;keys dict) (&;values dict)))) @@ -96,7 +96,7 @@ (test "If you merge, and the second dict has overlapping keys, it should overwrite yours." (let [dict' (|> dict &;entries - (List/map (function [[k v]] [k (n.inc v)])) + (L/map (function [[k v]] [k (n.inc v)])) (&;from-list number;Hash<Nat>)) (^open) (&;Eq<Dict> number;Eq<Nat>)] (= dict' (&;merge dict' dict)))) |