diff options
Diffstat (limited to 'stdlib/test')
-rw-r--r-- | stdlib/test/test/lux.lux | 18 | ||||
-rw-r--r-- | stdlib/test/test/lux/data/number.lux | 18 | ||||
-rw-r--r-- | stdlib/test/test/lux/data/struct/tree/rose.lux (renamed from stdlib/test/test/lux/data/struct/tree.lux) | 2 | ||||
-rw-r--r-- | stdlib/test/test/lux/data/struct/tree/zipper.lux (renamed from stdlib/test/test/lux/data/struct/zipper.lux) | 14 | ||||
-rw-r--r-- | stdlib/test/test/lux/lexer/regex.lux (renamed from stdlib/test/test/lux/regex.lux) | 2 | ||||
-rw-r--r-- | stdlib/test/test/lux/macro/syntax.lux | 2 | ||||
-rw-r--r-- | stdlib/test/test/lux/math/simple.lux | 4 | ||||
-rw-r--r-- | stdlib/test/tests.lux | 6 |
8 files changed, 33 insertions, 33 deletions
diff --git a/stdlib/test/test/lux.lux b/stdlib/test/test/lux.lux index 6c1ea6f4b..cd394ac76 100644 --- a/stdlib/test/test/lux.lux +++ b/stdlib/test/test/lux.lux @@ -75,7 +75,7 @@ ["Int" R;int i.= i.< i.> i.<= i.>= i.min i.max] ["Nat" R;nat n.= n.< n.> n.<= n.>= n.min n.max] ["Real" R;real r.= r.< r.> r.<= r.>= r.min r.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>] @@ -97,10 +97,10 @@ (test: (format "[" category "] " "Multiplicative identity") [x rand-gen] (assert "" - ## Skip this test for Frac - ## because Frac division loses the last + ## Skip this test for Deg + ## because Deg division loses the last ## 32 bits of precision. - (or (T/= "Frac" category) + (or (T/= "Deg" category) (and (|> x (* <1>) (= x)) (|> x (/ <1>) (= x)))))) @@ -112,10 +112,10 @@ #let [r (<%> y x) x' (- r x)]] (assert "" - ## Skip this test for Frac - ## because Frac division loses the last + ## Skip this test for Deg + ## because Deg division loses the last ## 32 bits of precision. - (or (T/= "Frac" category) + (or (T/= "Deg" category) (or (> x' y) (|> x' (/ y) (* y) (= x')))) ))] @@ -123,7 +123,7 @@ ["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] ["Real" R;real r.= r.+ r.- r.* r./ r.% r.> 0.0 1.0 1000000.0 %r id math;floor] - ["Frac" R;frac f.= f.+ f.- f.* f./ f.% f.> .0 (_lux_proc ["frac" "max-value"] []) (_lux_proc ["frac" "max-value"] []) %f id id] + ["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] @@ -137,7 +137,7 @@ ["Nat->Int" R;nat nat-to-int int-to-nat n.= (n.% +1000000) %n %i] ["Int->Real" R;int int-to-real real-to-int i.= (i.% 1000000) %i %r] ["Real->Int" R;real real-to-int int-to-real r.= math;floor %r %i] - ## [R;real real-to-frac frac-to-real r.= (r.% 1.0) %r %f] + ## [R;real real-to-deg deg-to-real r.= (r.% 1.0) %r %f] ) (test: "Simple macros and constructs" diff --git a/stdlib/test/test/lux/data/number.lux b/stdlib/test/test/lux/data/number.lux index 20d72adf6..8b7267444 100644 --- a/stdlib/test/test/lux/data/number.lux +++ b/stdlib/test/test/lux/data/number.lux @@ -26,7 +26,7 @@ ["Nat" R;nat Eq<Nat> Ord<Nat>] ["Int" R;int Eq<Int> Ord<Int>] ["Real" R;real Eq<Real> Ord<Real>] - ["Frac" R;frac Eq<Frac> Ord<Frac>] + ["Deg" R;deg Eq<Deg> Ord<Deg>] ) (do-template [category rand-gen <Number>] @@ -39,14 +39,14 @@ (not (= x (negate x)))) (= x (negate (negate x))) ## There is loss of precision when multiplying - (or (Text/= "Frac" category) + (or (Text/= "Deg" category) (= x (* (signum x) (abs x)))))))] ## ["Nat" R;nat Number<Nat>] ["Int" R;int Number<Int>] ["Real" R;real Number<Real>] - ["Frac" R;frac Number<Frac>] + ["Deg" R;deg Number<Deg>] ) (do-template [category rand-gen <Enum> <Number>] @@ -79,7 +79,7 @@ ["Int" R;int Number<Int> Bounded<Int> (lambda [_] true)] ## Both min and max values will be positive (thus, greater than zero) ["Real" R;real Number<Real> Bounded<Real> (r.> 0.0)] - ["Frac" R;frac Number<Frac> Bounded<Frac> (lambda [_] true)] + ["Deg" R;deg Number<Deg> Bounded<Deg> (lambda [_] true)] ) (do-template [category rand-gen <Number> <Monoid> <cap> <test>] @@ -104,10 +104,10 @@ ["Real/Mul" R;real Number<Real> Mul@Monoid<Real> (r.% 1000.0) (r.> 0.0)] ["Real/Min" R;real Number<Real> Min@Monoid<Real> (r.% 1000.0) (r.> 0.0)] ["Real/Max" R;real Number<Real> Max@Monoid<Real> (r.% 1000.0) (r.> 0.0)] - ["Frac/Add" R;frac Number<Frac> Add@Monoid<Frac> (f.% .125) (lambda [_] true)] - ## ["Frac/Mul" R;frac Number<Frac> Mul@Monoid<Frac> (f.% .125) (lambda [_] true)] - ["Frac/Min" R;frac Number<Frac> Min@Monoid<Frac> (f.% .125) (lambda [_] true)] - ["Frac/Max" R;frac Number<Frac> Max@Monoid<Frac> (f.% .125) (lambda [_] true)] + ["Deg/Add" R;deg Number<Deg> Add@Monoid<Deg> (d.% .125) (lambda [_] true)] + ## ["Deg/Mul" R;deg Number<Deg> Mul@Monoid<Deg> (d.% .125) (lambda [_] true)] + ["Deg/Min" R;deg Number<Deg> Min@Monoid<Deg> (d.% .125) (lambda [_] true)] + ["Deg/Max" R;deg Number<Deg> Max@Monoid<Deg> (d.% .125) (lambda [_] true)] ) (do-template [<category> <rand-gen> <Number> <Codec>] @@ -126,7 +126,7 @@ ["Nat" R;nat Number<Nat> Codec<Text,Nat>] ["Int" R;int Number<Int> Codec<Text,Int>] ["Real" R;real Number<Real> Codec<Text,Real>] - ["Frac" R;frac Number<Frac> Codec<Text,Frac>] + ["Deg" R;deg Number<Deg> Codec<Text,Deg>] ) (do-template [<category> <rand-gen> <Number> <Codec>] diff --git a/stdlib/test/test/lux/data/struct/tree.lux b/stdlib/test/test/lux/data/struct/tree/rose.lux index 91a81355e..21592aba9 100644 --- a/stdlib/test/test/lux/data/struct/tree.lux +++ b/stdlib/test/test/lux/data/struct/tree/rose.lux @@ -7,7 +7,7 @@ lux (lux (codata [io]) (control monad) - (data (struct ["&" tree] + (data (struct (tree ["&" rose]) [list "List/" Monad<List>]) [number]) ["R" random] diff --git a/stdlib/test/test/lux/data/struct/zipper.lux b/stdlib/test/test/lux/data/struct/tree/zipper.lux index 37ada2859..f2d7fe708 100644 --- a/stdlib/test/test/lux/data/struct/zipper.lux +++ b/stdlib/test/test/lux/data/struct/tree/zipper.lux @@ -7,9 +7,9 @@ lux (lux (codata [io]) (control monad) - (data (struct ["&" zipper] - [tree] - [list "List/" Fold<List> Functor<List>]) + (data (struct [list "List/" Fold<List> Functor<List>] + (tree ["&" zipper] + [rose])) [text "Text/" Monoid<Text>] text/format [number]) @@ -19,7 +19,7 @@ lux/test) (def: gen-tree - (R;Random (tree;Tree Nat)) + (R;Random (rose;Tree Nat)) (R;rec (lambda [gen-tree] (do R;Monad<Random> ## Each branch can have, at most, 1 child. @@ -39,7 +39,7 @@ new-val R;nat pre-val R;nat post-val R;nat - #let [(^open "Tree/") (tree;Eq<Tree> number;Eq<Nat>) + #let [(^open "Tree/") (rose;Eq<Tree> number;Eq<Nat>) (^open "List/") (list;Eq<List> number;Eq<Nat>)]] ($_ seq (assert "Trees can be converted to/from zippers." @@ -102,7 +102,7 @@ (|> sample &;from-tree (&;set new-val) &;value (n.= new-val))) (assert "Zipper traversal follows the outline of the tree depth-first." - (List/= (tree;flatten sample) + (List/= (rose;flatten sample) (loop [zipper (&;from-tree sample)] (if (&;end? zipper) (list (&;value zipper)) @@ -110,7 +110,7 @@ (recur (&;next zipper))))))) (assert "Backwards zipper traversal yield reverse tree flatten." - (List/= (list;reverse (tree;flatten sample)) + (List/= (list;reverse (rose;flatten sample)) (loop [zipper (to-end (&;from-tree sample))] (if (&;root? zipper) (list (&;value zipper)) diff --git a/stdlib/test/test/lux/regex.lux b/stdlib/test/test/lux/lexer/regex.lux index 6c6854ce0..4a9f01c27 100644 --- a/stdlib/test/test/lux/regex.lux +++ b/stdlib/test/test/lux/lexer/regex.lux @@ -17,7 +17,7 @@ ["R" random] pipe [lexer] - ["&" regex]) + (lexer ["&" regex])) lux/test) ## [Utils] diff --git a/stdlib/test/test/lux/macro/syntax.lux b/stdlib/test/test/lux/macro/syntax.lux index 1fabb09ad..2755bbf8e 100644 --- a/stdlib/test/test/lux/macro/syntax.lux +++ b/stdlib/test/test/lux/macro/syntax.lux @@ -79,7 +79,7 @@ ["Can parse Bool syntax." true ast;bool bool;Eq<Bool> s;bool] ["Can parse Nat syntax." +123 ast;nat number;Eq<Nat> s;nat] ["Can parse Int syntax." 123 ast;int number;Eq<Int> s;int] - ["Can parse Frac syntax." .123 ast;frac number;Eq<Frac> s;frac] + ["Can parse Deg syntax." .123 ast;deg number;Eq<Deg> s;deg] ["Can parse Real syntax." 123.0 ast;real number;Eq<Real> s;real] ["Can parse Char syntax." #"\n" ast;char char;Eq<Char> s;char] ["Can parse Text syntax." "\n" ast;text text;Eq<Text> s;text] diff --git a/stdlib/test/test/lux/math/simple.lux b/stdlib/test/test/lux/math/simple.lux index bfa313708..235723f25 100644 --- a/stdlib/test/test/lux/math/simple.lux +++ b/stdlib/test/test/lux/math/simple.lux @@ -40,7 +40,7 @@ ["Nat" R;nat n.= n.+ n.- n.* n./ n.% +0] ["Int" R;int i.= i.+ i.- i.* i./ i.% 0] ["Real" R;real r.= r.+ r.- r.* r./ r.% 0.0] - ## ["Frac" R;frac f.= f.+ f.- f.* f./ f.% .0] + ["Deg" R;deg d.= d.+ d.- d.* d./ d.% .0] ) (do-template [<category> <generator> <lt> <lte> <gt> <gte>] @@ -61,7 +61,7 @@ ["Nat" R;nat n.< n.<= n.> n.>=] ["Int" R;int i.< i.<= i.> i.>=] ["Real" R;real r.< r.<= r.> r.>=] - ## ["Frac" R;frac f.< f.<= f.> f.>=] + ["Deg" R;deg d.< d.<= d.> d.>=] ) (do-template [<category> <generator> <=> <min> <max>] diff --git a/stdlib/test/tests.lux b/stdlib/test/tests.lux index c57ca61c5..8e0c165c1 100644 --- a/stdlib/test/tests.lux +++ b/stdlib/test/tests.lux @@ -15,7 +15,7 @@ ["_;" host] ["_;" pipe] ["_;" lexer] - ["_;" regex] + (lexer ["_;" regex]) (codata ["_;" io] ["_;" env] ["_;" state] @@ -47,9 +47,9 @@ [queue] [set] [stack] - [tree] ## [vector] - [zipper]) + (tree [rose] + [zipper])) (text [format]) ) ["_;" math] |