aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test/test/lux.lux
diff options
context:
space:
mode:
authorEduardo Julian2017-10-16 19:28:04 -0400
committerEduardo Julian2017-10-16 19:28:04 -0400
commitfecfb6c1dd653e491e541233395ea4a7d8ae7409 (patch)
tree1083a8cbe6f8277a75fc7813f9a403a4db9e5732 /stdlib/test/test/lux.lux
parentb2b8a0ffda0661511d8aec5634aad314b1e6c710 (diff)
- Re-named "Result" type back to "Error".
Diffstat (limited to '')
-rw-r--r--stdlib/test/test/lux.lux44
1 files changed, 22 insertions, 22 deletions
diff --git a/stdlib/test/test/lux.lux b/stdlib/test/test/lux.lux
index 546d7f14f..5ff53793c 100644
--- a/stdlib/test/test/lux.lux
+++ b/stdlib/test/test/lux.lux
@@ -4,7 +4,7 @@
(lux (control ["M" monad #+ do Monad])
[io]
[math]
- ["R" math/random]
+ ["r" math/random]
(data [maybe]
[text "T/" Eq<Text>]
text/format)
@@ -12,9 +12,9 @@
(macro ["s" syntax #+ syntax:])))
(context: "Value identity."
- [size (|> R;nat (:: @ map (|>. (n.% +100) (n.max +10))))
- x (R;text size)
- y (R;text size)]
+ [size (|> r;nat (:: @ map (|>. (n.% +100) (n.max +10))))
+ x (r;text size)
+ y (r;text size)]
($_ seq
(test "Every value is identical to itself, and the 'id' function doesn't change values in any way."
(and (is x x)
@@ -44,8 +44,8 @@
(and (|> value inc even?)
(|> value dec even?)))))]
- ["Nat" R;nat n.inc n.dec n.even? n.odd? n.= n.< n.>]
- ["Int" R;int i.inc i.dec i.even? i.odd? i.= i.< i.>]
+ ["Nat" r;nat n.inc n.dec n.even? n.odd? n.= n.< n.>]
+ ["Int" r;int i.inc i.dec i.even? i.odd? i.= i.< i.>]
)
(do-template [category rand-gen = < > <= >= min max]
@@ -68,10 +68,10 @@
(>= y (max x y)))
)))]
- ["Int" R;int i.= i.< i.> i.<= i.>= i.min i.max]
- ["Nat" R;nat n.= n.< n.> n.<= n.>= n.min n.max]
- ["Frac" R;frac f.= f.< f.> f.<= f.>= f.min f.max]
- ["Deg" R;deg d.= d.< d.> d.<= d.>= d.min d.max]
+ ["Int" r;int i.= i.< i.> i.<= i.>= i.min i.max]
+ ["Nat" r;nat n.= n.< n.> n.<= n.>= n.min n.max]
+ ["Frac" r;frac f.= f.< f.> f.<= f.>= f.min f.max]
+ ["Deg" r;deg d.= d.< d.> d.<= d.>= d.min d.max]
)
(do-template [category rand-gen = + - * / <%> > <0> <1> <factor> %x <cap> <prep>]
@@ -104,7 +104,7 @@
[x (:: @ map <cap> rand-gen)
y (|> rand-gen
(:: @ map <cap>)
- (R;filter (|>. (= <0>) not)))
+ (r;filter (|>. (= <0>) not)))
#let [r (<%> y x)
x' (- r x)]]
(test ""
@@ -116,10 +116,10 @@
(|> x' (/ y) (* y) (= x'))))
))]
- ["Nat" R;nat n.= n.+ n.- n.* n./ n.% n.> +0 +1 +1000000 %n (n.% +1000) id]
- ["Int" R;int i.= i.+ i.- i.* i./ i.% i.> 0 1 1000000 %i (i.% 1000) id]
- ["Frac" R;frac f.= f.+ f.- f.* f./ f.% f.> 0.0 1.0 1000000.0 %r id math;floor]
- ["Deg" R;deg d.= d.+ d.- d.* d./ d.% d.> .0 (_lux_proc ["deg" "max-value"] []) (_lux_proc ["deg" "max-value"] []) %f id id]
+ ["Nat" r;nat n.= n.+ n.- n.* n./ n.% n.> +0 +1 +1000000 %n (n.% +1000) id]
+ ["Int" r;int i.= i.+ i.- i.* i./ i.% i.> 0 1 1000000 %i (i.% 1000) id]
+ ["Frac" r;frac f.= f.+ f.- f.* f./ f.% f.> 0.0 1.0 1000000.0 %r id math;floor]
+ ["Deg" r;deg d.= d.+ d.- d.* d./ d.% d.> .0 (_lux_proc ["deg" "max-value"] []) (_lux_proc ["deg" "max-value"] []) %f id id]
)
(do-template [category rand-gen -> <- = <cap> %a %z]
@@ -129,11 +129,11 @@
(test ""
(|> value -> <- (= value))))]
- ["Int->Nat" R;int int-to-nat nat-to-int i.= (i.% 1000000) %i %n]
- ["Nat->Int" R;nat nat-to-int int-to-nat n.= (n.% +1000000) %n %i]
- ["Int->Frac" R;int int-to-frac frac-to-int i.= (i.% 1000000) %i %r]
- ["Frac->Int" R;frac frac-to-int int-to-frac f.= math;floor %r %i]
- ## [R;frac frac-to-deg deg-to-frac f.= (f.% 1.0) %r %f]
+ ["Int->Nat" r;int int-to-nat nat-to-int i.= (i.% 1000000) %i %n]
+ ["Nat->Int" r;nat nat-to-int int-to-nat n.= (n.% +1000000) %n %i]
+ ["Int->Frac" r;int int-to-frac frac-to-int i.= (i.% 1000000) %i %r]
+ ["Frac->Int" r;frac frac-to-int int-to-frac f.= math;floor %r %i]
+ ## [r;frac frac-to-deg deg-to-frac f.= (f.% 1.0) %r %f]
)
(context: "Simple macros and constructs"
@@ -173,8 +173,8 @@
(i.+ (i.* x x) (i.* y y)))
(context: "Templates"
- [x R;int
- y R;int]
+ [x r;int
+ y r;int]
(test "Template application is a stand-in for the templated code."
(i.= (i.+ (i.* x x) (i.* y y))
(hypotenuse x y))))