aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/test')
-rw-r--r--stdlib/test/test/lux/data/struct/zipper.lux12
-rw-r--r--stdlib/test/test/lux/math/complex.lux4
2 files changed, 8 insertions, 8 deletions
diff --git a/stdlib/test/test/lux/data/struct/zipper.lux b/stdlib/test/test/lux/data/struct/zipper.lux
index a1045f44f..8e45b4ef1 100644
--- a/stdlib/test/test/lux/data/struct/zipper.lux
+++ b/stdlib/test/test/lux/data/struct/zipper.lux
@@ -56,8 +56,8 @@
(let [child (|> zipper &;down)]
(and (not (Tree/= sample (&;to-tree child)))
(|> child &;parent (default (undefined)) (is zipper))
- (|> child &;up (is zipper))
- (|> child &;root (is zipper))))
+ (|> child &;up (is zipper) not)
+ (|> child &;root (is zipper) not)))
(and (&;leaf? zipper)
(|> zipper (&;prepend-child new-val) &;branch?)))))
@@ -72,7 +72,7 @@
(|> zipper &;down &;right &;value (is mid-val))
(|> zipper &;down &;right &;right &;value (is post-val))
(|> zipper &;down &;rightmost &;leftmost &;value (is pre-val))
- (|> zipper &;down &;right &;left &;value (is mid-val))
+ (|> zipper &;down &;right &;left &;value (is pre-val))
(|> zipper &;down &;rightmost &;value (is post-val))))
true)))
@@ -91,7 +91,7 @@
(|> zipper &;down &;right &;value (is mid-val))
(|> zipper &;down &;right &;right &;value (is post-val))
(|> zipper &;down &;rightmost &;leftmost &;value (is pre-val))
- (|> zipper &;down &;right &;left &;value (is mid-val))
+ (|> zipper &;down &;right &;left &;value (is pre-val))
(|> zipper &;down &;rightmost &;value (is post-val))))
(and (|> zipper (&;insert-left pre-val) (case> (#;Some _) false
#;None true))
@@ -105,7 +105,7 @@
(List/= (tree;flatten sample)
(loop [zipper (&;from-tree sample)]
(if (&;end? zipper)
- (list)
+ (list (&;value zipper))
(#;Cons (&;value zipper)
(recur (&;next zipper)))))))
@@ -113,7 +113,7 @@
(List/= (list;reverse (tree;flatten sample))
(loop [zipper (to-end (&;from-tree sample))]
(if (&;root? zipper)
- (list)
+ (list (&;value zipper))
(#;Cons (&;value zipper)
(recur (&;prev zipper)))))))
diff --git a/stdlib/test/test/lux/math/complex.lux b/stdlib/test/test/lux/math/complex.lux
index d3259ba31..fad780410 100644
--- a/stdlib/test/test/lux/math/complex.lux
+++ b/stdlib/test/test/lux/math/complex.lux
@@ -37,8 +37,8 @@
(def: gen-dim
(R;Random Real)
(do R;Monad<Random>
- [factor (|> R;nat (:: @ map (n.% +1000)))
- measure R;real]
+ [factor (|> R;nat (:: @ map (|>. (n.% +1000) (n.max +1))))
+ measure (|> R;real (R;filter (r.> 0.0)))]
(wrap (r.* (|> factor nat-to-int int-to-real)
measure))))