aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test
diff options
context:
space:
mode:
authorEduardo Julian2018-07-10 19:54:59 -0400
committerEduardo Julian2018-07-10 19:54:59 -0400
commit18c7510daf68df970ca0400a5c0e0530236cf2bb (patch)
tree3070a2430f7c311d91e2a0396d8ab8d98856af35 /stdlib/test
parent631b52a83f7ee64c46a893cdd347289276afe210 (diff)
- Re-named "Dict" type to "Dictionary".
Diffstat (limited to '')
-rw-r--r--stdlib/test/test/lux/data/coll/dictionary/ordered.lux4
-rw-r--r--stdlib/test/test/lux/data/coll/dictionary/unordered.lux20
-rw-r--r--stdlib/test/test/lux/data/format/json.lux8
-rw-r--r--stdlib/test/test/lux/data/format/xml.lux2
-rw-r--r--stdlib/test/test/lux/lang/compiler/synthesis/function.lux4
-rw-r--r--stdlib/test/test/lux/lang/syntax.lux2
-rw-r--r--stdlib/test/test/lux/math/random.lux2
7 files changed, 21 insertions, 21 deletions
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<Dict> number.Equivalence<Nat>)]]
+ (^open "&/") (&.Equivalence<Dictionary> number.Equivalence<Nat>)]]
($_ 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<Random> map (n/% +100) r.nat)]
size capped-nat
- dict (r.dict number.Hash<Nat> size r.nat capped-nat)
+ dict (r.dictionary 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.Equivalence<Nat> (&.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<Dict> number.Equivalence<Nat>)]
+ (test "A Dictionary should equal itself & going to<->from lists shouldn't change that."
+ (let [(^open) (&.Equivalence<Dictionary> number.Equivalence<Nat>)]
(and (= dict dict)
(|> dict &.entries (&.from-list number.Hash<Nat>) (= dict)))))
- (test "Merging a Dict to itself changes nothing."
- (let [(^open) (&.Equivalence<Dict> number.Equivalence<Nat>)]
+ (test "Merging a Dictionary to itself changes nothing."
+ (let [(^open) (&.Equivalence<Dictionary> number.Equivalence<Nat>)]
(= 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<Nat>))
- (^open) (&.Equivalence<Dict> number.Equivalence<Nat>)]
+ (^open) (&.Equivalence<Dictionary> number.Equivalence<Nat>)]
(= 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<Text> size (r.unicode size) gen-json)
+ (r.dictionary text.Hash<Text> 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<Text> size (r.unicode size) r.frac)
+ (r.dictionary text.Hash<Text> 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<Text> = (get@ #text recL) (get@ #text recR))
(:: (maybe.Equivalence<Maybe> number.Equivalence<Frac>) = (get@ #maybe recL) (get@ #maybe recR))
(:: (list.Equivalence<List> number.Equivalence<Frac>) = (get@ #list recL) (get@ #list recR))
- (:: (d.Equivalence<Dict> number.Equivalence<Frac>) = (get@ #dict recL) (get@ #dict recR))
+ (:: (d.Equivalence<Dictionary> number.Equivalence<Frac>) = (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<Ident> size xml-identifier^ (xml-text^ +0 +10))
+ (r.dictionary ident.Hash<Ident> 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<List> Fold<List>]
- (dictionary ["dict" unordered #+ Dict])
+ (dictionary ["dict" unordered #+ Dictionary])
(set ["set" unordered])))
(lang ["///." reference #+ Variable "variable/" Equivalence<Variable>]
["///." 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<Nat>))
(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<Random>]
(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<Nat> size r.nat)
- _dict (r.dict number.Hash<Nat> size r.nat r.nat)
+ _dict (r.dictionary number.Hash<Nat> size r.nat r.nat)
top r.nat
filtered (|> r.nat (r.filter (n/<= top)))
shuffle-seed r.nat