From ae9d81b215047553f03a857d04183e9862338c6c Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 20 Dec 2016 23:52:20 -0400 Subject: - Updated tests for lux/data/struct/zipper and lux/math/complex. --- stdlib/test/test/lux/data/struct/zipper.lux | 12 ++++++------ stdlib/test/test/lux/math/complex.lux | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'stdlib/test') 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 - [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)))) -- cgit v1.2.3