aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test/test/lux.lux
diff options
context:
space:
mode:
authorEduardo Julian2018-05-13 00:47:43 -0400
committerEduardo Julian2018-05-13 00:47:43 -0400
commit38742d7c110f5a28f9ea4aec117cc531ac6c9b5e (patch)
tree47e75d21064c216e6156f68764b94fc86526633f /stdlib/test/test/lux.lux
parent6717fc5e4aaf5986cd4f0d4ea1a12793188cbe9a (diff)
- Added new #I64 type as foundation for types based on 64-bit integers.
Diffstat (limited to '')
-rw-r--r--stdlib/test/test/lux.lux30
1 files changed, 15 insertions, 15 deletions
diff --git a/stdlib/test/test/lux.lux b/stdlib/test/test/lux.lux
index 788085db4..1f0a6e115 100644
--- a/stdlib/test/test/lux.lux
+++ b/stdlib/test/test/lux.lux
@@ -26,7 +26,7 @@
(not (is? x y)))
))))
-(do-template [category rand-gen inc dec even? odd? = < >]
+(do-template [category rand-gen even? odd? = < >]
[(context: (format "[" category "] " "Moving up-down or down-up should result in same value.")
(<| (times +100)
(do @
@@ -52,8 +52,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/even? n/odd? n/= n/< n/>]
+ ["Int" r.int i/even? i/odd? i/= i/< i/>]
)
(do-template [category rand-gen = < > <= >= min max]
@@ -86,7 +86,7 @@
["Deg" r.deg d/= d/< d/> d/<= d/>= d/min d/max]
)
-(do-template [category rand-gen = + - * / <%> > <0> <1> <factor> %x <cap> <prep>]
+(do-template [category rand-gen = + - * / <%> > <0> <1> <factor> <cap> <prep>]
[(context: (format "[" category "] " "Additive identity")
(<| (times +100)
(do @
@@ -136,10 +136,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 (:! Deg -1) (:! Deg -1) %f id id]
+ ["Nat" r.nat n/= n/+ n/- n/* n// n/% n/> +0 +1 +1_000_000 (n/% +1_000) id]
+ ["Int" r.int i/= i/+ i/- i/* i// i/% i/> 0 1 1_000_000 (i/% 1_000) id]
+ ["Frac" r.frac f/= f/+ f/- f/* f// f/% f/> 0.0 1.0 1_000_000.0 id math.floor]
+ ["Deg" r.deg d/= d/+ d/- d/* d// d/% d/> .0 (.deg -1) (.deg -1) id id]
)
(def: frac-deg
@@ -147,7 +147,7 @@
(|> r.deg
(:: r.Functor<Random> map (|>> (:! Nat) (bit.left-shift +11) (bit.right-shift +11) (:! Deg)))))
-(do-template [category rand-gen -> <- = <cap> %a %z]
+(do-template [category rand-gen -> <- = <cap>]
[(context: (format "[" category "] " "Numeric conversions")
(<| (times +100)
(do @
@@ -156,11 +156,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]
- ["Deg->Frac" frac-deg deg-to-frac frac-to-deg d/= id %d %r]
+ ["Int->Nat" r.int .nat .int i/= (i/% 1_000_000)]
+ ["Nat->Int" r.nat .int .nat n/= (n/% +1_000_000)]
+ ["Int->Frac" r.int int-to-frac frac-to-int i/= (i/% 1_000_000)]
+ ["Frac->Int" r.frac frac-to-int int-to-frac f/= math.floor]
+ ["Deg->Frac" frac-deg deg-to-frac frac-to-deg d/= id]
)
(context: "Simple macros and constructs"
@@ -170,7 +170,7 @@
(loop [counter 0
value 1]
(if (i/< 3 counter)
- (recur (i/inc counter) (i/* 10 value))
+ (recur (inc counter) (i/* 10 value))
value))))
(test "Can create lists easily through macros."