aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test
diff options
context:
space:
mode:
authorEduardo Julian2018-07-21 23:57:21 -0400
committerEduardo Julian2018-07-21 23:57:21 -0400
commit9671d6064dd02dfe6c32492f5b9907b096e5bd89 (patch)
treedb89e3908dedd606ce5838096bc5df9ebcc9b1c4 /stdlib/test
parent22d10692d87ac1c07fc14f6100917b913bb0f8b3 (diff)
Re-named "seq" to "and" and "alt" to "or".
Diffstat (limited to '')
-rw-r--r--stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux2
-rw-r--r--stdlib/test/test/lux/compiler/default/phase/synthesis/primitive.lux2
-rw-r--r--stdlib/test/test/lux/compiler/default/syntax.lux4
-rw-r--r--stdlib/test/test/lux/concurrency/promise.lux10
-rw-r--r--stdlib/test/test/lux/data/collection/tree/rose/zipper.lux2
-rw-r--r--stdlib/test/test/lux/data/color.lux2
-rw-r--r--stdlib/test/test/lux/data/format/json.lux12
-rw-r--r--stdlib/test/test/lux/data/format/xml.lux16
-rw-r--r--stdlib/test/test/lux/data/text/lexer.lux8
-rw-r--r--stdlib/test/test/lux/macro/poly/equivalence.lux10
-rw-r--r--stdlib/test/test/lux/macro/syntax.lux10
-rw-r--r--stdlib/test/test/lux/type.lux12
-rw-r--r--stdlib/test/test/lux/type/check.lux2
-rw-r--r--stdlib/test/test/lux/world/binary.lux2
14 files changed, 47 insertions, 47 deletions
diff --git a/stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux b/stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux
index ce34ff887..9a5595f22 100644
--- a/stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux
+++ b/stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux
@@ -34,7 +34,7 @@
(r.Random [Type Code])
(`` ($_ r.either
(~~ (do-template [<type> <code-wrapper> <value-gen>]
- [(r.seq (random/wrap <type>) (random/map <code-wrapper> <value-gen>))]
+ [(r.and (random/wrap <type>) (random/map <code-wrapper> <value-gen>))]
[Any code.tuple (r.list +0 ..unit)]
[Bit code.bit r.bit]
diff --git a/stdlib/test/test/lux/compiler/default/phase/synthesis/primitive.lux b/stdlib/test/test/lux/compiler/default/phase/synthesis/primitive.lux
index 4312f2bae..cdeeea22b 100644
--- a/stdlib/test/test/lux/compiler/default/phase/synthesis/primitive.lux
+++ b/stdlib/test/test/lux/compiler/default/phase/synthesis/primitive.lux
@@ -23,7 +23,7 @@
(r.Random Analysis)
(do r.Monad<Random>
[primitive (: (r.Random analysis.Primitive)
- ($_ r.alt
+ ($_ r.or
(wrap [])
r.bit
r.nat
diff --git a/stdlib/test/test/lux/compiler/default/syntax.lux b/stdlib/test/test/lux/compiler/default/syntax.lux
index 8717f03fa..07befa13c 100644
--- a/stdlib/test/test/lux/compiler/default/syntax.lux
+++ b/stdlib/test/test/lux/compiler/default/syntax.lux
@@ -43,7 +43,7 @@
(def: name^
(r.Random Name)
- (r.seq name-part^ name-part^))
+ (r.and name-part^ name-part^))
(def: code^
(r.Random Code)
@@ -76,7 +76,7 @@
(|> multi^ (r/map code.tuple))
(do r.Monad<Random>
[size (|> r.nat (r/map (n/% +3)))]
- (|> (r.list size (r.seq code^ code^))
+ (|> (r.list size (r.and code^ code^))
(r/map code.record)))))]
(r.either simple^
composite^))))))
diff --git a/stdlib/test/test/lux/concurrency/promise.lux b/stdlib/test/test/lux/concurrency/promise.lux
index 7dda27503..76c5df05c 100644
--- a/stdlib/test/test/lux/concurrency/promise.lux
+++ b/stdlib/test/test/lux/concurrency/promise.lux
@@ -23,16 +23,16 @@
#1)))
(wrap (do &.Monad<Promise>
- [[left right] (&.seq (&.future (io.io #1))
+ [[left right] (&.and (&.future (io.io #1))
(&.future (io.io #0)))]
(assert "Can combine promises sequentially."
(and left (not right)))))
(wrap (do &.Monad<Promise>
- [?left (&.alt (&.delay +100 #1)
- (&.delay +200 #0))
- ?right (&.alt (&.delay +200 #1)
- (&.delay +100 #0))]
+ [?left (&.or (&.delay +100 #1)
+ (&.delay +200 #0))
+ ?right (&.or (&.delay +200 #1)
+ (&.delay +100 #0))]
(assert "Can combine promises alternatively."
(case [?left ?right]
[(#.Left #1) (#.Right #0)]
diff --git a/stdlib/test/test/lux/data/collection/tree/rose/zipper.lux b/stdlib/test/test/lux/data/collection/tree/rose/zipper.lux
index 01ba51e80..8ac987570 100644
--- a/stdlib/test/test/lux/data/collection/tree/rose/zipper.lux
+++ b/stdlib/test/test/lux/data/collection/tree/rose/zipper.lux
@@ -23,7 +23,7 @@
(do r.Monad<Random>
## Each branch can have, at most, 1 child.
[size (|> r.nat (:: @ map (n/% +2)))]
- (r.seq r.nat
+ (r.and r.nat
(r.list size gen-tree))))))
(def: (to-end zipper)
diff --git a/stdlib/test/test/lux/data/color.lux b/stdlib/test/test/lux/data/color.lux
index d9555a79c..42d48806a 100644
--- a/stdlib/test/test/lux/data/color.lux
+++ b/stdlib/test/test/lux/data/color.lux
@@ -11,7 +11,7 @@
(def: color
(r.Random @.Color)
- (|> ($_ r.seq r.nat r.nat r.nat)
+ (|> ($_ r.and r.nat r.nat r.nat)
(:: r.Monad<Random> map @.color)))
(def: scale
diff --git a/stdlib/test/test/lux/data/format/json.lux b/stdlib/test/test/lux/data/format/json.lux
index 60cecbd6d..0f1f6ebce 100644
--- a/stdlib/test/test/lux/data/format/json.lux
+++ b/stdlib/test/test/lux/data/format/json.lux
@@ -45,7 +45,7 @@
(r.rec (function (_ gen-json)
(do r.Monad<Random>
[size (:: @ map (n/% +2) r.nat)]
- ($_ r.alt
+ ($_ r.or
(:: @ wrap [])
r.bit
(|> r.frac (:: @ map (f/* 1_000_000.0)))
@@ -101,8 +101,8 @@
(def: gen-recursive
(r.Random Recursive)
(r.rec (function (_ gen-recursive)
- (r.alt r.frac
- (r.seq r.frac gen-recursive)))))
+ (r.or r.frac
+ (r.and r.frac gen-recursive)))))
(derived: (poly/equivalence.Equivalence<?> Recursive))
@@ -114,15 +114,15 @@
(r.Random Record)
(do r.Monad<Random>
[size (:: @ map (n/% +2) r.nat)]
- ($_ r.seq
+ ($_ r.and
r.bit
r.frac
(r.unicode size)
(r.maybe r.frac)
(r.list size r.frac)
(r.dictionary text.Hash<Text> size (r.unicode size) r.frac)
- ## ($_ r.alt r.bit (r.unicode size) r.frac)
- ## ($_ r.seq r.bit r.frac (r.unicode size))
+ ## ($_ r.or r.bit (r.unicode size) r.frac)
+ ## ($_ r.and r.bit r.frac (r.unicode size))
gen-recursive
## _instant.instant
_duration.duration
diff --git a/stdlib/test/test/lux/data/format/xml.lux b/stdlib/test/test/lux/data/format/xml.lux
index 37eec4169..e1e773a96 100644
--- a/stdlib/test/test/lux/data/format/xml.lux
+++ b/stdlib/test/test/lux/data/format/xml.lux
@@ -44,19 +44,19 @@
(def: xml-identifier^
(r.Random Name)
- (r.seq (xml-text^ +0 +10)
+ (r.and (xml-text^ +0 +10)
(xml-text^ +1 +10)))
(def: gen-xml
(r.Random &.XML)
(r.rec (function (_ gen-xml)
- (r.alt (xml-text^ +1 +10)
- (do r.Monad<Random>
- [size (size^ +0 +2)]
- ($_ r.seq
- xml-identifier^
- (r.dictionary name.Hash<Name> size xml-identifier^ (xml-text^ +0 +10))
- (r.list size gen-xml)))))))
+ (r.or (xml-text^ +1 +10)
+ (do r.Monad<Random>
+ [size (size^ +0 +2)]
+ ($_ r.and
+ xml-identifier^
+ (r.dictionary name.Hash<Name> size xml-identifier^ (xml-text^ +0 +10))
+ (r.list size gen-xml)))))))
(context: "XML."
(<| (times +100)
diff --git a/stdlib/test/test/lux/data/text/lexer.lux b/stdlib/test/test/lux/data/text/lexer.lux
index 392b0ccc8..9654c29e6 100644
--- a/stdlib/test/test/lux/data/text/lexer.lux
+++ b/stdlib/test/test/lux/data/text/lexer.lux
@@ -164,17 +164,17 @@
($_ seq
(test "Can combine lexers sequentially."
(and (|> (&.run "YO"
- (p.seq &.any &.any))
+ (p.and &.any &.any))
(case> (#.Right ["Y" "O"]) #1
_ #0))
(should-fail (&.run "Y"
- (p.seq &.any &.any)))))
+ (p.and &.any &.any)))))
(test "Can create the opposite of a lexer."
(and (should-passT "a" (&.run "a"
- (&.not (p.alt &.decimal &.upper))))
+ (&.not (p.or &.decimal &.upper))))
(should-fail (&.run "A"
- (&.not (p.alt &.decimal &.upper))))))
+ (&.not (p.or &.decimal &.upper))))))
(test "Can select from among a set of characters."
(and (should-passT "C" (&.run "C"
diff --git a/stdlib/test/test/lux/macro/poly/equivalence.lux b/stdlib/test/test/lux/macro/poly/equivalence.lux
index 3e554442b..40dae030c 100644
--- a/stdlib/test/test/lux/macro/poly/equivalence.lux
+++ b/stdlib/test/test/lux/macro/poly/equivalence.lux
@@ -42,23 +42,23 @@
(def: gen-recursive
(r.Random Recursive)
(r.rec (function (_ gen-recursive)
- (r.alt r.frac
- (r.seq r.frac gen-recursive)))))
+ (r.or r.frac
+ (r.and r.frac gen-recursive)))))
(def: gen-record
(r.Random Record)
(do r.Monad<Random>
[size (:: @ map (n/% +2) r.nat)
#let [gen-int (|> r.int (:: @ map (|>> int/abs (i/% 1_000_000))))]]
- ($_ r.seq
+ ($_ r.and
r.bit
gen-int
r.frac
(r.unicode size)
(r.maybe gen-int)
(r.list size gen-int)
- ($_ r.alt r.bit gen-int r.frac)
- ($_ r.seq gen-int r.frac (r.unicode size))
+ ($_ r.or r.bit gen-int r.frac)
+ ($_ r.and gen-int r.frac (r.unicode size))
gen-recursive)))
(derived: (&.Equivalence<?> Record))
diff --git a/stdlib/test/test/lux/macro/syntax.lux b/stdlib/test/test/lux/macro/syntax.lux
index dfeacb0c6..155f7985a 100644
--- a/stdlib/test/test/lux/macro/syntax.lux
+++ b/stdlib/test/test/lux/macro/syntax.lux
@@ -105,7 +105,7 @@
[(test (format "Can parse " <type> " syntax.")
(and (match [#1 123]
(p.run (list (<ctor> (list (code.bit #1) (code.int 123))))
- (<parser> (p.seq s.bit s.int))))
+ (<parser> (p.and s.bit s.int))))
(match #1
(p.run (list (<ctor> (list (code.bit #1))))
(<parser> s.bit)))
@@ -113,12 +113,12 @@
(<parser> s.bit)))
(match (#.Left #1)
(p.run (list (<ctor> (list (code.bit #1))))
- (<parser> (p.alt s.bit s.int))))
+ (<parser> (p.or s.bit s.int))))
(match (#.Right 123)
(p.run (list (<ctor> (list (code.int 123))))
- (<parser> (p.alt s.bit s.int))))
+ (<parser> (p.or s.bit s.int))))
(fails? (p.run (list (<ctor> (list (code.frac 123.0))))
- (<parser> (p.alt s.bit s.int))))))]
+ (<parser> (p.or s.bit s.int))))))]
["form" s.form code.form]
["tuple" s.tuple code.tuple])]
@@ -128,7 +128,7 @@
(test "Can parse record syntax."
(match [#1 123]
(p.run (list (code.record (list [(code.bit #1) (code.int 123)])))
- (s.record (p.seq s.bit s.int)))))
+ (s.record (p.and s.bit s.int)))))
)))
(context: "Combinators"
diff --git a/stdlib/test/test/lux/type.lux b/stdlib/test/test/lux/type.lux
index 611f7bd60..1c950eb40 100644
--- a/stdlib/test/test/lux/type.lux
+++ b/stdlib/test/test/lux/type.lux
@@ -23,17 +23,17 @@
(def: #export gen-name
(r.Random Name)
- (r.seq gen-short gen-short))
+ (r.and gen-short gen-short))
(def: #export gen-type
(r.Random Type)
(let [(^open "R/.") r.Monad<Random>]
(r.rec (function (_ gen-type)
- (let [pairG (r.seq gen-type gen-type)
+ (let [pairG (r.and gen-type gen-type)
idG r.nat
- quantifiedG (r.seq (R/wrap (list)) gen-type)]
- ($_ r.alt
- (r.seq gen-short (R/wrap (list)))
+ quantifiedG (r.and (R/wrap (list)) gen-type)]
+ ($_ r.or
+ (r.and gen-short (R/wrap (list)))
pairG
pairG
pairG
@@ -43,7 +43,7 @@
quantifiedG
quantifiedG
pairG
- (r.seq gen-name gen-type)
+ (r.and gen-name gen-type)
))))))
## [Tests]
diff --git a/stdlib/test/test/lux/type/check.lux b/stdlib/test/test/lux/type/check.lux
index b1d0365e1..b801c1cd5 100644
--- a/stdlib/test/test/lux/type/check.lux
+++ b/stdlib/test/test/lux/type/check.lux
@@ -181,7 +181,7 @@
(do @
[num-connections (|> r.nat (:: @ map (n/% +100)))
boundT (|> //.gen-type (r.filter (|>> (case> (#.Var _) #0 _ #1))))
- pick-pcg (r.seq r.nat r.nat)]
+ pick-pcg (r.and r.nat r.nat)]
($_ seq
(test "Can create rings of variables."
(type-checks? (do @.Monad<Check>
diff --git a/stdlib/test/test/lux/world/binary.lux b/stdlib/test/test/lux/world/binary.lux
index 25c59c88d..acc3161c1 100644
--- a/stdlib/test/test/lux/world/binary.lux
+++ b/stdlib/test/test/lux/world/binary.lux
@@ -57,7 +57,7 @@
random-binary (binary binary-size)
value r.nat
#let [gen-idx (|> r.nat (:: @ map (n/% binary-size)))]
- [from to] (r.seq gen-idx gen-idx)
+ [from to] (r.and gen-idx gen-idx)
#let [[from to] [(n/min from to) (n/max from to)]]]
($_ seq
## TODO: De-comment...