From 18c7510daf68df970ca0400a5c0e0530236cf2bb Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 10 Jul 2018 19:54:59 -0400 Subject: - Re-named "Dict" type to "Dictionary". --- .../test/test/lux/data/coll/dictionary/ordered.lux | 4 ++-- .../test/test/lux/data/coll/dictionary/unordered.lux | 20 ++++++++++---------- stdlib/test/test/lux/data/format/json.lux | 8 ++++---- stdlib/test/test/lux/data/format/xml.lux | 2 +- .../test/lux/lang/compiler/synthesis/function.lux | 4 ++-- stdlib/test/test/lux/lang/syntax.lux | 2 +- stdlib/test/test/lux/math/random.lux | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) (limited to 'stdlib/test') diff --git a/stdlib/test/test/lux/data/coll/dictionary/ordered.lux b/stdlib/test/test/lux/data/coll/dictionary/ordered.lux index bb13ac532..bfcd4b569 100644 --- a/stdlib/test/test/lux/data/coll/dictionary/ordered.lux +++ b/stdlib/test/test/lux/data/coll/dictionary/ordered.lux @@ -12,7 +12,7 @@ ["r" math/random]) lux/test) -(context: "Dict" +(context: "Dictionary" (<| (times +100) (do @ [size (|> r.nat (:: @ map (n/% +100))) @@ -27,7 +27,7 @@ (n/< left right)) pairs) sorted-values (L/map product.right sorted-pairs) - (^open "&/") (&.Equivalence number.Equivalence)]] + (^open "&/") (&.Equivalence number.Equivalence)]] ($_ seq (test "Can query the size of a dictionary." (n/= size (&.size sample))) diff --git a/stdlib/test/test/lux/data/coll/dictionary/unordered.lux b/stdlib/test/test/lux/data/coll/dictionary/unordered.lux index bde4810a5..3476898b6 100644 --- a/stdlib/test/test/lux/data/coll/dictionary/unordered.lux +++ b/stdlib/test/test/lux/data/coll/dictionary/unordered.lux @@ -17,14 +17,14 @@ (do @ [#let [capped-nat (:: r.Monad map (n/% +100) r.nat)] size capped-nat - dict (r.dict number.Hash size r.nat capped-nat) + dict (r.dictionary number.Hash 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.Equivalence (&.values dict) val)))))] ($_ seq - (test "Size function should correctly represent Dict size." + (test "Size function should correctly represent Dictionary size." (n/= size (&.size dict))) - (test "Dicts of size 0 should be considered empty." + (test "Dictionaries of size 0 should be considered empty." (if (n/= +0 size) (&.empty? dict) (not (&.empty? dict)))) @@ -35,7 +35,7 @@ (list.zip2 (&.keys dict) (&.values dict)))) - (test "Dict should be able to recognize it's own keys." + (test "Dictionary should be able to recognize it's own keys." (list.every? (function (_ key) (&.contains? key dict)) (&.keys dict))) @@ -82,26 +82,26 @@ _ false))) - (test "Additions and removals to a Dict should affect its size." + (test "Additions and removals to a Dictionary should affect its size." (let [plus (&.put non-key test-val dict) base (&.remove non-key plus)] (and (n/= (inc (&.size dict)) (&.size plus)) (n/= (dec (&.size plus)) (&.size base))))) - (test "A Dict should equal itself & going to<->from lists shouldn't change that." - (let [(^open) (&.Equivalence number.Equivalence)] + (test "A Dictionary should equal itself & going to<->from lists shouldn't change that." + (let [(^open) (&.Equivalence number.Equivalence)] (and (= dict dict) (|> dict &.entries (&.from-list number.Hash) (= dict))))) - (test "Merging a Dict to itself changes nothing." - (let [(^open) (&.Equivalence number.Equivalence)] + (test "Merging a Dictionary to itself changes nothing." + (let [(^open) (&.Equivalence number.Equivalence)] (= dict (&.merge dict dict)))) (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 (inc v)])) (&.from-list number.Hash)) - (^open) (&.Equivalence number.Equivalence)] + (^open) (&.Equivalence number.Equivalence)] (= dict' (&.merge dict' dict)))) (test "Can merge values in such a way that they become combined." diff --git a/stdlib/test/test/lux/data/format/json.lux b/stdlib/test/test/lux/data/format/json.lux index cb90b5df5..27e9850e0 100644 --- a/stdlib/test/test/lux/data/format/json.lux +++ b/stdlib/test/test/lux/data/format/json.lux @@ -44,7 +44,7 @@ (|> r.frac (:: @ map (f/* 1_000_000.0))) (r.unicode size) (r.row size gen-json) - (r.dict text.Hash size (r.unicode size) gen-json) + (r.dictionary text.Hash size (r.unicode size) gen-json) ))))) (context: "JSON" @@ -81,7 +81,7 @@ #text Text #maybe (Maybe Frac) #list (List Frac) - #dict (d.Dict Text Frac) + #dict (d.Dictionary Text Frac) ## #variant Variant ## #tuple [Bool Frac Text] #recursive Recursive @@ -113,7 +113,7 @@ (r.unicode size) (r.maybe r.frac) (r.list size r.frac) - (r.dict text.Hash size (r.unicode size) r.frac) + (r.dictionary text.Hash size (r.unicode size) r.frac) ## ($_ r.alt r.bool (r.unicode size) r.frac) ## ($_ r.seq r.bool r.frac (r.unicode size)) gen-recursive @@ -145,7 +145,7 @@ (:: text.Equivalence = (get@ #text recL) (get@ #text recR)) (:: (maybe.Equivalence number.Equivalence) = (get@ #maybe recL) (get@ #maybe recR)) (:: (list.Equivalence number.Equivalence) = (get@ #list recL) (get@ #list recR)) - (:: (d.Equivalence number.Equivalence) = (get@ #dict recL) (get@ #dict recR)) + (:: (d.Equivalence number.Equivalence) = (get@ #dict recL) (get@ #dict recR)) ## (variant/= (get@ #variant recL) (get@ #variant recR)) ## (let [[tL0 tL1 tL2] (get@ #tuple recL) ## [tR0 tR1 tR2] (get@ #tuple recR)] diff --git a/stdlib/test/test/lux/data/format/xml.lux b/stdlib/test/test/lux/data/format/xml.lux index 27d904a98..acdd2aec8 100644 --- a/stdlib/test/test/lux/data/format/xml.lux +++ b/stdlib/test/test/lux/data/format/xml.lux @@ -52,7 +52,7 @@ [size (size^ +0 +2)] ($_ r.seq xml-identifier^ - (r.dict ident.Hash size xml-identifier^ (xml-text^ +0 +10)) + (r.dictionary ident.Hash size xml-identifier^ (xml-text^ +0 +10)) (r.list size gen-xml))))))) (context: "XML." diff --git a/stdlib/test/test/lux/lang/compiler/synthesis/function.lux b/stdlib/test/test/lux/lang/compiler/synthesis/function.lux index 92e5dcc72..ba7d015e2 100644 --- a/stdlib/test/test/lux/lang/compiler/synthesis/function.lux +++ b/stdlib/test/test/lux/lang/compiler/synthesis/function.lux @@ -9,7 +9,7 @@ [number] text/format (coll [list "list/" Functor Fold] - (dictionary ["dict" unordered #+ Dict]) + (dictionary ["dict" unordered #+ Dictionary]) (set ["set" unordered]))) (lang ["///." reference #+ Variable "variable/" Equivalence] ["///." compiler] @@ -54,7 +54,7 @@ (let [current-env/size (list.size current-env) resolver (list/fold (function (_ [idx var] resolver) (dict.put idx var resolver)) - (: (Dict Nat Variable) + (: (Dictionary Nat Variable) (dict.new number.Hash)) (list.enumerate current-env))] (do @ diff --git a/stdlib/test/test/lux/lang/syntax.lux b/stdlib/test/test/lux/lang/syntax.lux index 929ecaca0..d9a16b2c3 100644 --- a/stdlib/test/test/lux/lang/syntax.lux +++ b/stdlib/test/test/lux/lang/syntax.lux @@ -8,7 +8,7 @@ (text format ["l" lexer]) (coll [list] - (dictionary ["dict" unordered #+ Dict]))) + (dictionary ["dict" unordered #+ Dictionary]))) ["r" math/random "r/" Monad] (macro [code]) (lang ["&" syntax]) diff --git a/stdlib/test/test/lux/math/random.lux b/stdlib/test/test/lux/math/random.lux index 2096edcfe..46d9edef4 100644 --- a/stdlib/test/test/lux/math/random.lux +++ b/stdlib/test/test/lux/math/random.lux @@ -24,7 +24,7 @@ _queue (r.queue size r.nat) _stack (r.stack size r.nat) _set (r.set number.Hash size r.nat) - _dict (r.dict number.Hash size r.nat r.nat) + _dict (r.dictionary number.Hash size r.nat r.nat) top r.nat filtered (|> r.nat (r.filter (n/<= top))) shuffle-seed r.nat -- cgit v1.2.3