From 15e71e57b688f5079fe606b2fee5e3efd2a5d5a7 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 28 Jul 2018 14:55:30 -0400 Subject: Added "+" sign to positive Int. --- stdlib/test/test/lux.lux | 26 ++++----- stdlib/test/test/lux/compiler/default/syntax.lux | 2 +- stdlib/test/test/lux/concurrency/frp.lux | 24 ++++---- stdlib/test/test/lux/control/parser.lux | 68 +++++++++++------------ stdlib/test/test/lux/control/pipe.lux | 70 ++++++++++++------------ stdlib/test/test/lux/control/reader.lux | 28 +++++----- stdlib/test/test/lux/control/writer.lux | 24 ++++---- stdlib/test/test/lux/data/collection/list.lux | 8 +-- stdlib/test/test/lux/data/color.lux | 24 ++++---- stdlib/test/test/lux/data/error.lux | 28 +++++----- stdlib/test/test/lux/data/format/json.lux | 2 +- stdlib/test/test/lux/data/maybe.lux | 8 +-- stdlib/test/test/lux/data/number.lux | 26 ++++----- stdlib/test/test/lux/data/number/complex.lux | 18 +++--- stdlib/test/test/lux/data/number/i64.lux | 6 +- stdlib/test/test/lux/data/product.lux | 10 ++-- stdlib/test/test/lux/data/sum.lux | 18 +++--- stdlib/test/test/lux/data/text/format.lux | 6 +- stdlib/test/test/lux/host.js.lux | 8 +-- stdlib/test/test/lux/io.lux | 20 +++---- stdlib/test/test/lux/macro/code.lux | 24 ++++---- stdlib/test/test/lux/macro/poly/equivalence.lux | 2 +- stdlib/test/test/lux/macro/syntax.lux | 22 ++++---- stdlib/test/test/lux/math.lux | 14 ++--- stdlib/test/test/lux/math/modular.lux | 10 ++-- stdlib/test/test/lux/time/duration.lux | 4 +- stdlib/test/test/lux/time/instant.lux | 2 +- stdlib/test/test/lux/world/file.lux | 6 +- 28 files changed, 254 insertions(+), 254 deletions(-) (limited to 'stdlib/test') diff --git a/stdlib/test/test/lux.lux b/stdlib/test/test/lux.lux index df0bb8278..f52b7764e 100644 --- a/stdlib/test/test/lux.lux +++ b/stdlib/test/test/lux.lux @@ -126,8 +126,8 @@ ))))] ["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] + ["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] ["Rev" r.rev r/= r/+ r/- r/* r// r/% r/> .0 (.rev -1) (.rev -1) id id] ) @@ -145,9 +145,9 @@ (test "" (|> value -> <- (= value))))))] - ["Int->Nat" r.int .nat .int i/= (i/% 1_000_000)] + ["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)] + ["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] ["Rev->Frac" frac-rev rev-to-frac frac-to-rev r/= id] ) @@ -155,23 +155,23 @@ (context: "Simple macros and constructs" ($_ seq (test "Can write easy loops for iterative programming." - (i/= 1000 - (loop [counter 0 - value 1] - (if (i/< 3 counter) - (recur (inc counter) (i/* 10 value)) + (i/= +1000 + (loop [counter +0 + value +1] + (if (i/< +3 counter) + (recur (inc counter) (i/* +10 value)) value)))) (test "Can create lists easily through macros." - (and (case (list 1 2 3) - (#.Cons 1 (#.Cons 2 (#.Cons 3 #.Nil))) + (and (case (list +1 +2 +3) + (#.Cons +1 (#.Cons +2 (#.Cons +3 #.Nil))) #1 _ #0) - (case (list& 1 2 3 (list 4 5 6)) - (#.Cons 1 (#.Cons 2 (#.Cons 3 (#.Cons 4 (#.Cons 5 (#.Cons 6 #.Nil)))))) + (case (list& +1 +2 +3 (list +4 +5 +6)) + (#.Cons +1 (#.Cons +2 (#.Cons +3 (#.Cons +4 (#.Cons +5 (#.Cons +6 #.Nil)))))) #1 _ diff --git a/stdlib/test/test/lux/compiler/default/syntax.lux b/stdlib/test/test/lux/compiler/default/syntax.lux index 76cc98717..5bd7c09d8 100644 --- a/stdlib/test/test/lux/compiler/default/syntax.lux +++ b/stdlib/test/test/lux/compiler/default/syntax.lux @@ -119,7 +119,7 @@ [numerator (|> r.nat (:: @ map (|>> (n/% |100) .int int-to-frac))) denominator (|> r.nat (:: @ map (|>> (n/% |100) (n/max |1) .int int-to-frac))) signed? r.bit - #let [expected (|> numerator (f// denominator) (f/* (if signed? -1.0 1.0)))]] + #let [expected (|> numerator (f// denominator) (f/* (if signed? -1.0 +1.0)))]] (test "Can parse frac ratio syntax." (case (&.read "" (dict.new text.Hash) [default-cursor |0 diff --git a/stdlib/test/test/lux/concurrency/frp.lux b/stdlib/test/test/lux/concurrency/frp.lux index 668882485..7ba1a80e9 100644 --- a/stdlib/test/test/lux/concurrency/frp.lux +++ b/stdlib/test/test/lux/concurrency/frp.lux @@ -35,7 +35,7 @@ (let [(^open "list/.") (list.Equivalence number.Equivalence)] ($_ seq (wrap (do promise.Monad - [#let [values (list 0 1 2 3 4 5)] + [#let [values (list +0 +1 +2 +3 +4 +5)] output (promise.future (do io.Monad [#let [input (: (Channel Int) (frp.channel []))] @@ -54,12 +54,12 @@ [#let [input (: (Channel Int) (frp.channel [])) elems (frp.filter i/even? input)] output (read! elems) - _ (write! (list 0 1 2 3 4 5) input)] + _ (write! (list +0 +1 +2 +3 +4 +5) input)] (wrap output))) _ (promise.wait |100) output (promise.future (atom.read output))] (assert "Can filter a channel's elements." - (list/= (list 0 2 4) + (list/= (list +0 +2 +4) (list.reverse output))))) (wrap (do promise.Monad @@ -69,13 +69,13 @@ right (: (Channel Int) (frp.channel []))] merged (frp.merge (list left right)) output (read! merged) - _ (write! (list 0 1 2 3 4 5) left) - _ (write! (list 0 -1 -2 -3 -4 -5) right)] + _ (write! (list +0 +1 +2 +3 +4 +5) left) + _ (write! (list +0 -1 -2 -3 -4 -5) right)] (wrap output))) _ (promise.wait |100) output (promise.future (atom.read output))] (assert "Can merge channels." - (list/= (list 0 1 2 3 4 5 0 -1 -2 -3 -4 -5) + (list/= (list +0 +1 +2 +3 +4 +5 +0 -1 -2 -3 -4 -5) (list.reverse output))))) (wrap (do promise.Monad @@ -84,12 +84,12 @@ [#let [inputs (: (Channel Int) (frp.channel [])) mapped (:: frp.Functor map inc inputs)] output (read! mapped) - _ (write! (list 0 1 2 3 4 5) inputs)] + _ (write! (list +0 +1 +2 +3 +4 +5) inputs)] (wrap output))) _ (promise.wait |100) output (promise.future (atom.read output))] (assert "Functor goes over every element in a channel." - (list/= (list 1 2 3 4 5 6) + (list/= (list +1 +2 +3 +4 +5 +6) (list.reverse output))))) (wrap (do promise.Monad @@ -100,23 +100,23 @@ output (read! (let [(^open ".") frp.Apply] (apply >f< >a<))) _ (write! (list inc) >f<) - _ (write! (list 12345) >a<)] + _ (write! (list +12345) >a<)] (wrap output))) _ (promise.wait |100) output (promise.future (atom.read output))] (assert "Apply works over all channel values." - (list/= (list 12346) + (list/= (list +12346) (list.reverse output))))) (wrap (do promise.Monad [output (promise.future (read! (do frp.Monad [f (frp.from-promise (promise.delay |100 inc)) - a (frp.from-promise (promise.delay |200 12345))] + a (frp.from-promise (promise.delay |200 +12345))] (frp.from-promise (promise.delay |300 (f a)))))) _ (promise.wait |700) output (promise.future (atom.read output))] (assert "Valid monad." - (list/= (list 12346) + (list/= (list +12346) (list.reverse output))))) ))) diff --git a/stdlib/test/test/lux/control/parser.lux b/stdlib/test/test/lux/control/parser.lux index c4f42a7b7..19ed2000d 100644 --- a/stdlib/test/test/lux/control/parser.lux +++ b/stdlib/test/test/lux/control/parser.lux @@ -59,9 +59,9 @@ (context: "Assertions" (test "Can make assertions while parsing." (and (match [] - (&.run (list (code.bit #1) (code.int 123)) + (&.run (list (code.bit #1) (code.int +123)) (&.assert "yolo" #1))) - (fails? (&.run (list (code.bit #1) (code.int 123)) + (fails? (&.run (list (code.bit #1) (code.int +123)) (&.assert "yolo" #0)))))) (context: "Combinators [Part 1]" @@ -96,22 +96,22 @@ (let [positive (: (s.Syntax Int) (do &.Monad [value s.int - _ (&.assert "" (i/> 0 value))] + _ (&.assert "" (i/> +0 value))] (wrap value)))] - (and (match 123 - (&.run (list (code.int 123) (code.int 456) (code.int 789)) + (and (match +123 + (&.run (list (code.int +123) (code.int +456) (code.int +789)) (&.either positive s.int))) (match -123 - (&.run (list (code.int -123) (code.int 456) (code.int 789)) + (&.run (list (code.int -123) (code.int +456) (code.int +789)) (&.either positive s.int))) - (fails? (&.run (list (code.bit #1) (code.int 456) (code.int 789)) + (fails? (&.run (list (code.bit #1) (code.int +456) (code.int +789)) (&.either positive s.int)))))) (test "Can create the opposite/negation of any parser." - (and (fails? (&.run (list (code.int 123) (code.int 456) (code.int 789)) + (and (fails? (&.run (list (code.int +123) (code.int +456) (code.int +789)) (&.not s.int))) (match [] - (&.run (list (code.bit #1) (code.int 456) (code.int 789)) + (&.run (list (code.bit #1) (code.int +456) (code.int +789)) (&.not s.int))))) )) @@ -122,53 +122,53 @@ (&.fail "Well, it really SHOULD fail...")))) (test "Can apply a parser N times." - (and (match (list 123 456 789) - (&.run (list (code.int 123) (code.int 456) (code.int 789)) + (and (match (list +123 +456 +789) + (&.run (list (code.int +123) (code.int +456) (code.int +789)) (&.exactly |3 s.int))) - (match (list 123 456) - (&.run (list (code.int 123) (code.int 456) (code.int 789)) + (match (list +123 +456) + (&.run (list (code.int +123) (code.int +456) (code.int +789)) (&.exactly |2 s.int))) - (fails? (&.run (list (code.int 123) (code.int 456) (code.int 789)) + (fails? (&.run (list (code.int +123) (code.int +456) (code.int +789)) (&.exactly |4 s.int))))) (test "Can apply a parser at-least N times." - (and (match (list 123 456 789) - (&.run (list (code.int 123) (code.int 456) (code.int 789)) + (and (match (list +123 +456 +789) + (&.run (list (code.int +123) (code.int +456) (code.int +789)) (&.at-least |3 s.int))) - (match (list 123 456 789) - (&.run (list (code.int 123) (code.int 456) (code.int 789)) + (match (list +123 +456 +789) + (&.run (list (code.int +123) (code.int +456) (code.int +789)) (&.at-least |2 s.int))) - (fails? (&.run (list (code.int 123) (code.int 456) (code.int 789)) + (fails? (&.run (list (code.int +123) (code.int +456) (code.int +789)) (&.at-least |4 s.int))))) (test "Can apply a parser at-most N times." - (and (match (list 123 456 789) - (&.run (list (code.int 123) (code.int 456) (code.int 789)) + (and (match (list +123 +456 +789) + (&.run (list (code.int +123) (code.int +456) (code.int +789)) (&.at-most |3 s.int))) - (match (list 123 456) - (&.run (list (code.int 123) (code.int 456) (code.int 789)) + (match (list +123 +456) + (&.run (list (code.int +123) (code.int +456) (code.int +789)) (&.at-most |2 s.int))) - (match (list 123 456 789) - (&.run (list (code.int 123) (code.int 456) (code.int 789)) + (match (list +123 +456 +789) + (&.run (list (code.int +123) (code.int +456) (code.int +789)) (&.at-most |4 s.int))))) (test "Can apply a parser between N and M times." - (and (match (list 123 456 789) - (&.run (list (code.int 123) (code.int 456) (code.int 789)) + (and (match (list +123 +456 +789) + (&.run (list (code.int +123) (code.int +456) (code.int +789)) (&.between |3 |10 s.int))) - (fails? (&.run (list (code.int 123) (code.int 456) (code.int 789)) + (fails? (&.run (list (code.int +123) (code.int +456) (code.int +789)) (&.between |4 |10 s.int))))) (test "Can parse while taking separators into account." - (and (match (list 123 456 789) - (&.run (list (code.int 123) (code.text "YOLO") (code.int 456) (code.text "YOLO") (code.int 789)) + (and (match (list +123 +456 +789) + (&.run (list (code.int +123) (code.text "YOLO") (code.int +456) (code.text "YOLO") (code.int +789)) (&.sep-by (s.this (' "YOLO")) s.int))) - (match (list 123 456) - (&.run (list (code.int 123) (code.text "YOLO") (code.int 456) (code.int 789)) + (match (list +123 +456) + (&.run (list (code.int +123) (code.text "YOLO") (code.int +456) (code.int +789)) (&.sep-by (s.this (' "YOLO")) s.int))))) (test "Can obtain the whole of the remaining input." (|> &.remaining - (&.run (list (code.int 123) (code.int 456) (code.int 789))) - (match (list [_ (#.Int 123)] [_ (#.Int 456)] [_ (#.Int 789)])))) + (&.run (list (code.int +123) (code.int +456) (code.int +789))) + (match (list [_ (#.Int +123)] [_ (#.Int +456)] [_ (#.Int +789)])))) )) diff --git a/stdlib/test/test/lux/control/pipe.lux b/stdlib/test/test/lux/control/pipe.lux index 2cc09fbf8..e5ceaeb19 100644 --- a/stdlib/test/test/lux/control/pipe.lux +++ b/stdlib/test/test/lux/control/pipe.lux @@ -14,59 +14,59 @@ (context: "Pipes" ($_ seq (test "Can dismiss previous pipeline results and begin a new line." - (|> 20 - (i/* 3) - (i/+ 4) - (new> 0 inc) - (i/= 1))) + (|> +20 + (i/* +3) + (i/+ +4) + (new> +0 inc) + (i/= +1))) (test "Can give names to piped values within a pipeline's scope." - (|> 5 + (|> +5 (let> X [(i/+ X X)]) - (i/= 10))) + (i/= +10))) (test "Can do branching in pipelines." - (and (|> 5 - (cond> [i/even?] [(i/* 2)] - [i/odd?] [(i/* 3)] + (and (|> +5 + (cond> [i/even?] [(i/* +2)] + [i/odd?] [(i/* +3)] [(new> -1)]) - (i/= 15)) - (|> 4 - (cond> [i/even?] [(i/* 2)] - [i/odd?] [(i/* 3)] + (i/= +15)) + (|> +4 + (cond> [i/even?] [(i/* +2)] + [i/odd?] [(i/* +3)] []) - (i/= 8)) - (|> 5 - (cond> [i/even?] [(i/* 2)] + (i/= +8)) + (|> +5 + (cond> [i/even?] [(i/* +2)] [(new> -1)]) (i/= -1)))) (test "Can loop within pipelines." - (|> 1 - (loop> [(i/< 10)] + (|> +1 + (loop> [(i/< +10)] [inc]) - (i/= 10))) + (i/= +10))) (test "Can use monads within pipelines." - (|> 5 + (|> +5 (do> Monad - [(i/* 3)] - [(i/+ 4)] + [(i/* +3)] + [(i/+ +4)] [inc]) - (i/= 20))) + (i/= +20))) (test "Can pattern-match against piped values." - (|> 5 - (case> 0 "zero" - 1 "one" - 2 "two" - 3 "three" - 4 "four" - 5 "five" - 6 "six" - 7 "seven" - 8 "eight" - 9 "nine" + (|> +5 + (case> +0 "zero" + +1 "one" + +2 "two" + +3 "three" + +4 "four" + +5 "five" + +6 "six" + +7 "seven" + +8 "eight" + +9 "nine" _ "???") (text/= "five"))) )) diff --git a/stdlib/test/test/lux/control/reader.lux b/stdlib/test/test/lux/control/reader.lux index 135cce4ee..57f487426 100644 --- a/stdlib/test/test/lux/control/reader.lux +++ b/stdlib/test/test/lux/control/reader.lux @@ -11,27 +11,27 @@ (let [(^open "&/.") &.Apply (^open "&/.") &.Monad] ($_ seq - (test "" (i/= 123 (&.run 123 &.ask))) - (test "" (i/= 246 (&.run 123 (&.local (i/* 2) &.ask)))) - (test "" (i/= 134 (&.run 123 (&/map inc (i/+ 10))))) - (test "" (i/= 10 (&.run 123 (&/wrap 10)))) - (test "" (i/= 30 (&.run 123 (&/apply (&/wrap (i/+ 10)) (&/wrap 20))))) - (test "" (i/= 30 (&.run 123 (do &.Monad - [f (wrap i/+) - x (wrap 10) - y (wrap 20)] - (wrap (f x y))))))))) + (test "" (i/= +123 (&.run +123 &.ask))) + (test "" (i/= +246 (&.run +123 (&.local (i/* +2) &.ask)))) + (test "" (i/= +134 (&.run +123 (&/map inc (i/+ +10))))) + (test "" (i/= +10 (&.run +123 (&/wrap +10)))) + (test "" (i/= +30 (&.run +123 (&/apply (&/wrap (i/+ +10)) (&/wrap +20))))) + (test "" (i/= +30 (&.run +123 (do &.Monad + [f (wrap i/+) + x (wrap +10) + y (wrap +20)] + (wrap (f x y))))))))) (context: "Monad transformer" (let [(^open "io/.") io.Monad] (test "Can add reader functionality to any monad." (|> (: (&.Reader Text (io.IO Int)) (do (&.ReaderT io.Monad) - [a (&.lift (io/wrap 123)) - b (wrap 456)] + [a (&.lift (io/wrap +123)) + b (wrap +456)] (wrap (i/+ a b)))) (&.run "") io.run - (case> 579 #1 - _ #0))) + (case> +579 #1 + _ #0))) )) diff --git a/stdlib/test/test/lux/control/writer.lux b/stdlib/test/test/lux/control/writer.lux index 6b31046ea..de8bdc599 100644 --- a/stdlib/test/test/lux/control/writer.lux +++ b/stdlib/test/test/lux/control/writer.lux @@ -15,18 +15,18 @@ (^open "&/.") (&.Apply text.Monoid)] ($_ seq (test "Functor respects Writer." - (i/= 11 (product.right (&/map inc ["" 10])))) + (i/= +11 (product.right (&/map inc ["" +10])))) (test "Apply respects Writer." - (and (i/= 20 (product.right (&/wrap 20))) - (i/= 30 (product.right (&/apply (&/wrap (i/+ 10)) (&/wrap 20)))))) + (and (i/= +20 (product.right (&/wrap +20))) + (i/= +30 (product.right (&/apply (&/wrap (i/+ +10)) (&/wrap +20)))))) (test "Monad respects Writer." - (i/= 30 (product.right (do (&.Monad text.Monoid) - [f (wrap i/+) - a (wrap 10) - b (wrap 20)] - (wrap (f a b)))))) + (i/= +30 (product.right (do (&.Monad text.Monoid) + [f (wrap i/+) + a (wrap +10) + b (wrap +20)] + (wrap (f a b)))))) (test "Can log any value." (text/= "YOLO" (product.left (&.log "YOLO")))) @@ -37,9 +37,9 @@ (^open "io/.") io.Monad] (test "Can add writer functionality to any monad." (|> (io.run (do (&.WriterT text.Monoid io.Monad) - [a (lift (io/wrap 123)) - b (wrap 456)] + [a (lift (io/wrap +123)) + b (wrap +456)] (wrap (i/+ a b)))) - (case> ["" 579] #1 - _ #0))) + (case> ["" +579] #1 + _ #0))) )) diff --git a/stdlib/test/test/lux/data/collection/list.lux b/stdlib/test/test/lux/data/collection/list.lux index 9a8b4a4cd..dbe92f70a 100644 --- a/stdlib/test/test/lux/data/collection/list.lux +++ b/stdlib/test/test/lux/data/collection/list.lux @@ -232,8 +232,8 @@ (^open "io/.") io.Monad] (test "Can add list functionality to any monad." (|> (io.run (do (&.ListT io.Monad) - [a (lift (io/wrap 123)) - b (wrap 456)] + [a (lift (io/wrap +123)) + b (wrap +456)] (wrap (i/+ a b)))) - (case> (^ (list 579)) #1 - _ #0))))) + (case> (^ (list +579)) #1 + _ #0))))) diff --git a/stdlib/test/test/lux/data/color.lux b/stdlib/test/test/lux/data/color.lux index d8e93aa5e..7d584ab4b 100644 --- a/stdlib/test/test/lux/data/color.lux +++ b/stdlib/test/test/lux/data/color.lux @@ -18,18 +18,18 @@ (-> Nat Frac) (|>> .int int-to-frac)) -(def: square (-> Frac Frac) (math.pow 2.0)) +(def: square (-> Frac Frac) (math.pow +2.0)) (def: (distance from to) (-> @.Color @.Color Frac) (let [[fr fg fb] (@.unpack from) [tr tg tb] (@.unpack to)] - (math.pow 0.5 ($_ f/+ - (|> (scale tr) (f/- (scale fr)) square) - (|> (scale tg) (f/- (scale fg)) square) - (|> (scale tb) (f/- (scale fb)) square))))) + (math.pow +0.5 ($_ f/+ + (|> (scale tr) (f/- (scale fr)) square) + (|> (scale tg) (f/- (scale fg)) square) + (|> (scale tb) (f/- (scale fb)) square))))) -(def: error-margin Frac 1.8) +(def: error-margin Frac +1.8) (def: black @.Color (@.color [|0 |0 |0])) (def: white @.Color (@.color [|255 |255 |255])) @@ -49,14 +49,14 @@ (do @ [any color colorful (|> color - (r.filter (function (_ color) (|> (distance color black) (f/>= 100.0)))) - (r.filter (function (_ color) (|> (distance color white) (f/>= 100.0))))) + (r.filter (function (_ color) (|> (distance color black) (f/>= +100.0)))) + (r.filter (function (_ color) (|> (distance color white) (f/>= +100.0))))) mediocre (|> color (r.filter (|>> saturation ((function (_ saturation) - (and (f/>= 0.25 saturation) - (f/<= 0.75 saturation))))))) - ratio (|> r.frac (r.filter (f/>= 0.5)))] + (and (f/>= +0.25 saturation) + (f/<= +0.75 saturation))))))) + ratio (|> r.frac (r.filter (f/>= +0.5)))] ($_ seq (test "Has equivalence." (:: @.Equivalence = any any)) @@ -90,7 +90,7 @@ (saturation (@.de-saturate ratio mediocre)))) (test "Can gray-scale color." (let [gray'ed (@.gray-scale mediocre)] - (and (f/= 0.0 + (and (f/= +0.0 (saturation gray'ed)) (|> (luminance gray'ed) (f/- (luminance mediocre)) diff --git a/stdlib/test/test/lux/data/error.lux b/stdlib/test/test/lux/data/error.lux index bea6146aa..30a12855d 100644 --- a/stdlib/test/test/lux/data/error.lux +++ b/stdlib/test/test/lux/data/error.lux @@ -13,9 +13,9 @@ (^open "&/.") &.Monad] ($_ seq (test "Functor correctly handles both cases." - (and (|> (: (&.Error Int) (#&.Success 10)) + (and (|> (: (&.Error Int) (#&.Success +10)) (&/map inc) - (case> (#&.Success 11) #1 _ #0)) + (case> (#&.Success +11) #1 _ #0)) (|> (: (&.Error Int) (#&.Error "YOLO")) (&/map inc) @@ -23,24 +23,24 @@ )) (test "Apply correctly handles both cases." - (and (|> (&/wrap 20) - (case> (#&.Success 20) #1 _ #0)) - (|> (&/apply (&/wrap inc) (&/wrap 10)) - (case> (#&.Success 11) #1 _ #0)) + (and (|> (&/wrap +20) + (case> (#&.Success +20) #1 _ #0)) + (|> (&/apply (&/wrap inc) (&/wrap +10)) + (case> (#&.Success +11) #1 _ #0)) (|> (&/apply (&/wrap inc) (#&.Error "YOLO")) (case> (#&.Error "YOLO") #1 _ #0)))) (test "Monad correctly handles both cases." (and (|> (do &.Monad [f (wrap i/+) - a (wrap 10) - b (wrap 20)] + a (wrap +10) + b (wrap +20)] (wrap (f a b))) - (case> (#&.Success 30) #1 _ #0)) + (case> (#&.Success +30) #1 _ #0)) (|> (do &.Monad [f (wrap i/+) a (#&.Error "YOLO") - b (wrap 20)] + b (wrap +20)] (wrap (f a b))) (case> (#&.Error "YOLO") #1 _ #0)) )) @@ -51,8 +51,8 @@ (^open "io/.") io.Monad] (test "Can add error functionality to any monad." (|> (io.run (do (&.ErrorT io.Monad) - [a (lift (io/wrap 123)) - b (wrap 456)] + [a (lift (io/wrap +123)) + b (wrap +456)] (wrap (i/+ a b)))) - (case> (#&.Success 579) #1 - _ #0))))) + (case> (#&.Success +579) #1 + _ #0))))) diff --git a/stdlib/test/test/lux/data/format/json.lux b/stdlib/test/test/lux/data/format/json.lux index 5333cfb0e..a898a2c97 100644 --- a/stdlib/test/test/lux/data/format/json.lux +++ b/stdlib/test/test/lux/data/format/json.lux @@ -48,7 +48,7 @@ ($_ r.or (:: @ wrap []) r.bit - (|> r.frac (:: @ map (f/* 1_000_000.0))) + (|> r.frac (:: @ map (f/* +1_000_000.0))) (r.unicode size) (r.row size gen-json) (r.dictionary text.Hash size (r.unicode size) gen-json) diff --git a/stdlib/test/test/lux/data/maybe.lux b/stdlib/test/test/lux/data/maybe.lux index 95ee39d91..4f135b68a 100644 --- a/stdlib/test/test/lux/data/maybe.lux +++ b/stdlib/test/test/lux/data/maybe.lux @@ -49,8 +49,8 @@ (let [lift (&.lift io.Monad)] (test "Can add maybe functionality to any monad." (|> (io.run (do (&.MaybeT io.Monad) - [a (lift (io/wrap 123)) - b (wrap 456)] + [a (lift (io/wrap +123)) + b (wrap +456)] (wrap (i/+ a b)))) - (case> (#.Some 579) #1 - _ #0))))) + (case> (#.Some +579) #1 + _ #0))))) diff --git a/stdlib/test/test/lux/data/number.lux b/stdlib/test/test/lux/data/number.lux index 8e9a867da..c8e436d1d 100644 --- a/stdlib/test/test/lux/data/number.lux +++ b/stdlib/test/test/lux/data/number.lux @@ -87,7 +87,7 @@ ["Int" r.int Number Order Interval (function (_ _) #1)] ## Both min and max values will be positive (thus, greater than zero) ["Rev" r.rev Number Order Interval (function (_ _) #1)] - ["Frac" r.frac Number Order Interval (f/> 0.0)] + ["Frac" r.frac Number Order Interval (f/> +0.0)] ) (do-template [category rand-gen ] @@ -107,18 +107,18 @@ ["Nat/Mul" r.nat Number Order Mul@Monoid (n/% |1000) (function (_ _) #1)] ["Nat/Min" r.nat Number Order Min@Monoid (n/% |1000) (function (_ _) #1)] ["Nat/Max" r.nat Number Order Max@Monoid (n/% |1000) (function (_ _) #1)] - ["Int/Add" r.int Number Order Add@Monoid (i/% 1000) (function (_ _) #1)] - ["Int/Mul" r.int Number Order Mul@Monoid (i/% 1000) (function (_ _) #1)] - ["Int/Min" r.int Number Order Min@Monoid (i/% 1000) (function (_ _) #1)] - ["Int/Max" r.int Number Order Max@Monoid (i/% 1000) (function (_ _) #1)] + ["Int/Add" r.int Number Order Add@Monoid (i/% +1000) (function (_ _) #1)] + ["Int/Mul" r.int Number Order Mul@Monoid (i/% +1000) (function (_ _) #1)] + ["Int/Min" r.int Number Order Min@Monoid (i/% +1000) (function (_ _) #1)] + ["Int/Max" r.int Number Order Max@Monoid (i/% +1000) (function (_ _) #1)] ["Rev/Add" r.rev Number Order Add@Monoid (r/% .125) (function (_ _) #1)] ["Rev/Mul" r.rev Number Order Mul@Monoid (r/% .125) (function (_ _) #1)] ["Rev/Min" r.rev Number Order Min@Monoid (r/% .125) (function (_ _) #1)] ["Rev/Max" r.rev Number Order Max@Monoid (r/% .125) (function (_ _) #1)] - ["Frac/Add" r.frac Number Order Add@Monoid (f/% 1000.0) (f/> 0.0)] - ["Frac/Mul" r.frac Number Order Mul@Monoid (f/% 1000.0) (f/> 0.0)] - ["Frac/Min" r.frac Number Order Min@Monoid (f/% 1000.0) (f/> 0.0)] - ["Frac/Max" r.frac Number Order Max@Monoid (f/% 1000.0) (f/> 0.0)] + ["Frac/Add" r.frac Number Order Add@Monoid (f/% +1000.0) (f/> +0.0)] + ["Frac/Mul" r.frac Number Order Mul@Monoid (f/% +1000.0) (f/> +0.0)] + ["Frac/Min" r.frac Number Order Min@Monoid (f/% +1000.0) (f/> +0.0)] + ["Frac/Max" r.frac Number Order Max@Monoid (f/% +1000.0) (f/> +0.0)] ) (do-template [ ] @@ -170,14 +170,14 @@ ($_ seq (test "Binary." (and (n/= (bin "|11001001") (bin "|11_00_10_01")) - (i/= (bin "11001001") (bin "11_00_10_01")) + (i/= (bin "+11001001") (bin "+11_00_10_01")) (r/= (bin ".11001001") (bin ".11_00_10_01")) - (f/= (bin "1100.1001") (bin "11_00.10_01")))) + (f/= (bin "+1100.1001") (bin "+11_00.10_01")))) (test "Octal." (and (n/= (oct "|615243") (oct "|615_243")) - (i/= (oct "615243") (oct "615_243")) + (i/= (oct "+615243") (oct "+615_243")) (r/= (oct ".615243") (oct ".615_243")) - (f/= (oct "6152.43") (oct "615_2.43")))) + (f/= (oct "+6152.43") (oct "+615_2.43")))) (test "Hexadecimal." (and (n/= (hex "|deadBEEF") (hex "|dead_BEEF")) (i/= (hex "deadBEEF") (hex "dead_BEEF")) diff --git a/stdlib/test/test/lux/data/number/complex.lux b/stdlib/test/test/lux/data/number/complex.lux index 0d66cf1af..994e1cafb 100644 --- a/stdlib/test/test/lux/data/number/complex.lux +++ b/stdlib/test/test/lux/data/number/complex.lux @@ -12,7 +12,7 @@ ["r" random]]] lux/test) -(def: margin-of-error Frac 1.0e-9) +(def: margin-of-error Frac +1.0e-9) (def: (within? margin standard value) (-> Frac &.Complex &.Complex Bit) @@ -27,7 +27,7 @@ (r.Random Frac) (do r.Monad [factor (|> r.nat (:: @ map (|>> (n/% |1000) (n/max |1)))) - measure (|> r.frac (r.filter (f/> 0.0)))] + measure (|> r.frac (r.filter (f/> +0.0)))] (wrap (f/* (|> factor .int int-to-frac) measure)))) @@ -116,7 +116,7 @@ floored (|> quotient (update@ #&.real math.floor) (update@ #&.imaginary math.floor))] - (within? 0.000000000001 + (within? +0.000000000001 x (|> quotient (&.* y) (&.+ rem))))) )))) @@ -141,9 +141,9 @@ (test "Absolute value of signum is always root2(2), 1 or 0." (let [signum-abs (|> x &.signum &.abs (get@ #&.real))] - (or (f/= 0.0 signum-abs) - (f/= 1.0 signum-abs) - (f/= (math.pow 0.5 2.0) signum-abs)))) + (or (f/= +0.0 signum-abs) + (f/= +1.0 signum-abs) + (f/= (math.pow +0.5 +2.0) signum-abs)))) (test "Negation is its own inverse." (let [there (&.negate x) @@ -165,8 +165,8 @@ (<| (seed |17274883666004960943) ## (times |100) (do @ - [angle (|> gen-complex (:: @ map (|>> (update@ #&.real (f/% 1.0)) - (update@ #&.imaginary (f/% 1.0)))))] + [angle (|> gen-complex (:: @ map (|>> (update@ #&.real (f/% +1.0)) + (update@ #&.imaginary (f/% +1.0)))))] ($_ seq (test "Arc-sine is the inverse of sine." (trigonometric-symmetry &.sin &.asin angle)) @@ -183,7 +183,7 @@ [x gen-complex] ($_ seq (test "Root 2 is inverse of power 2." - (|> x (&.pow' 2.0) (&.pow' 0.5) (within? margin-of-error x))) + (|> x (&.pow' +2.0) (&.pow' +0.5) (within? margin-of-error x))) (test "Logarithm is inverse of exponentiation." (|> x &.log &.exp (within? margin-of-error x))) diff --git a/stdlib/test/test/lux/data/number/i64.lux b/stdlib/test/test/lux/data/number/i64.lux index 2868b91a6..96a174eaa 100644 --- a/stdlib/test/test/lux/data/number/i64.lux +++ b/stdlib/test/test/lux/data/number/i64.lux @@ -69,7 +69,7 @@ (n/= pattern)))) (test "Shift right respect the sign of ints." (let [value (.int pattern)] - (if (i/< 0 value) - (i/< 0 (&.arithmetic-right-shift idx value)) - (i/>= 0 (&.arithmetic-right-shift idx value))))) + (if (i/< +0 value) + (i/< +0 (&.arithmetic-right-shift idx value)) + (i/>= +0 (&.arithmetic-right-shift idx value))))) )))) diff --git a/stdlib/test/test/lux/data/product.lux b/stdlib/test/test/lux/data/product.lux index 440ccf62c..86db80d0e 100644 --- a/stdlib/test/test/lux/data/product.lux +++ b/stdlib/test/test/lux/data/product.lux @@ -7,11 +7,11 @@ (context: "Products" ($_ seq (test "Can access the sides of a pair." - (and (i/= 1 (@.left [1 2])) - (i/= 2 (@.right [1 2])))) + (and (i/= +1 (@.left [+1 +2])) + (i/= +2 (@.right [+1 +2])))) (test "Can swap the sides of a pair." - (let [[_left _right] (@.swap [1 2])] - (and (i/= 2 _left) - (i/= 1 _right)))) + (let [[_left _right] (@.swap [+1 +2])] + (and (i/= +2 _left) + (i/= +1 _right)))) )) diff --git a/stdlib/test/test/lux/data/sum.lux b/stdlib/test/test/lux/data/sum.lux index 23dfd6078..4023c1cc3 100644 --- a/stdlib/test/test/lux/data/sum.lux +++ b/stdlib/test/test/lux/data/sum.lux @@ -18,20 +18,20 @@ (test "Can discriminate eithers based on their cases." (let [[_lefts _rights] (partition (: (List (| Text Text)) - (list (|0 "0") (|1 "1") (|0 "2"))))] + (list (|0 "+0") (|1 "+1") (|0 "+2"))))] (and (List/= _lefts (lefts (: (List (| Text Text)) - (list (|0 "0") (|1 "1") (|0 "2"))))) + (list (|0 "+0") (|1 "+1") (|0 "+2"))))) (List/= _rights (rights (: (List (| Text Text)) - (list (|0 "0") (|1 "1") (|0 "2")))))))) + (list (|0 "+0") (|1 "+1") (|0 "+2")))))))) (test "Can apply a function to an Either value depending on the case." - (and (i/= 10 (either (function (_ _) 10) - (function (_ _) 20) - (: (| Text Text) (|0 "")))) - (i/= 20 (either (function (_ _) 10) - (function (_ _) 20) - (: (| Text Text) (|1 "")))))) + (and (i/= +10 (either (function (_ _) +10) + (function (_ _) +20) + (: (| Text Text) (|0 "")))) + (i/= +20 (either (function (_ _) +10) + (function (_ _) +20) + (: (| Text Text) (|1 "")))))) ))) diff --git a/stdlib/test/test/lux/data/text/format.lux b/stdlib/test/test/lux/data/text/format.lux index b66ee9f8e..adf4cdf7b 100644 --- a/stdlib/test/test/lux/data/text/format.lux +++ b/stdlib/test/test/lux/data/text/format.lux @@ -13,9 +13,9 @@ (test "Can format common values simply." (and (&/= "#1" (%b #1)) (&/= "|123" (%n |123)) - (&/= "123" (%i 123)) - (&/= "123.456" (%f 123.456)) + (&/= "+123" (%i +123)) + (&/= "+123.456" (%f +123.456)) (&/= ".5" (%r .5)) (&/= "\"YOLO\"" (%t "YOLO")) - (&/= "User-id: 123 -- Active: #1" (format "User-id: " (%i 123) " -- Active: " (%b #1))))) + (&/= "User-id: +123 -- Active: #1" (format "User-id: " (%i +123) " -- Active: " (%b #1))))) ))) diff --git a/stdlib/test/test/lux/host.js.lux b/stdlib/test/test/lux/host.js.lux index cba72d0ae..faf9f6b5f 100644 --- a/stdlib/test/test/lux/host.js.lux +++ b/stdlib/test/test/lux/host.js.lux @@ -21,8 +21,8 @@ (is? "BAR"))) (test "Can call JavaScript functions" - (and (is? 124.0 - (&.call! (&.ref "Math.ceil" &.Function) [123.45] Frac)) - (is? 124.0 - (&.call! (&.ref "Math") "ceil" [123.45] Frac)))) + (and (is? +124.0 + (&.call! (&.ref "Math.ceil" &.Function) [+123.45] Frac)) + (is? +124.0 + (&.call! (&.ref "Math") "ceil" [+123.45] Frac)))) )) diff --git a/stdlib/test/test/lux/io.lux b/stdlib/test/test/lux/io.lux index 1cef1097d..66cd4a730 100644 --- a/stdlib/test/test/lux/io.lux +++ b/stdlib/test/test/lux/io.lux @@ -12,13 +12,13 @@ (context: "I/O" ($_ seq (test "" (text/= "YOLO" (&.run (&.io "YOLO")))) - (test "" (i/= 11 (&.run (:: &.Functor map inc (&.io 10))))) - (test "" (i/= 10 (&.run (:: &.Monad wrap 10)))) - (test "" (i/= 30 (&.run (let [(^open "&/.") &.Apply - (^open "&/.") &.Monad] - (&/apply (&/wrap (i/+ 10)) (&/wrap 20)))))) - (test "" (i/= 30 (&.run (do &.Monad - [f (wrap i/+) - x (wrap 10) - y (wrap 20)] - (wrap (f x y)))))))) + (test "" (i/= +11 (&.run (:: &.Functor map inc (&.io +10))))) + (test "" (i/= +10 (&.run (:: &.Monad wrap +10)))) + (test "" (i/= +30 (&.run (let [(^open "&/.") &.Apply + (^open "&/.") &.Monad] + (&/apply (&/wrap (i/+ +10)) (&/wrap +20)))))) + (test "" (i/= +30 (&.run (do &.Monad + [f (wrap i/+) + x (wrap +10) + y (wrap +20)] + (wrap (f x y)))))))) diff --git a/stdlib/test/test/lux/macro/code.lux b/stdlib/test/test/lux/macro/code.lux index d4739c894..1e0d4a606 100644 --- a/stdlib/test/test/lux/macro/code.lux +++ b/stdlib/test/test/lux/macro/code.lux @@ -18,17 +18,17 @@ (and (text/= (&.to-text )) (:: &.Equivalence = )))] - [(&.bit #1) "#1"] - [(&.bit #0) "#0"] - [(&.int 123) "123"] - [(&.frac 123.0) "123.0"] - [(&.text "\n") "\"\\n\""] - [(&.tag ["yolo" "lol"]) "#yolo.lol"] - [(&.identifier ["yolo" "lol"]) "yolo.lol"] - [(&.form (list (&.bit #1) (&.int 123))) "(#1 123)"] - [(&.tuple (list (&.bit #1) (&.int 123))) "[#1 123]"] - [(&.record (list [(&.bit #1) (&.int 123)])) "{#1 123}"] - [(&.local-tag "lol") "#lol"] - [(&.local-identifier "lol") "lol"] + [(&.bit #1) "#1"] + [(&.bit #0) "#0"] + [(&.int +123) "+123"] + [(&.frac +123.0) "+123.0"] + [(&.text "\n") "\"\\n\""] + [(&.tag ["yolo" "lol"]) "#yolo.lol"] + [(&.identifier ["yolo" "lol"]) "yolo.lol"] + [(&.form (list (&.bit #1) (&.int +123))) "(#1 +123)"] + [(&.tuple (list (&.bit #1) (&.int +123))) "[#1 +123]"] + [(&.record (list [(&.bit #1) (&.int +123)])) "{#1 +123}"] + [(&.local-tag "lol") "#lol"] + [(&.local-identifier "lol") "lol"] )] ($_ seq ))) diff --git a/stdlib/test/test/lux/macro/poly/equivalence.lux b/stdlib/test/test/lux/macro/poly/equivalence.lux index 061b5714d..5d7cfee64 100644 --- a/stdlib/test/test/lux/macro/poly/equivalence.lux +++ b/stdlib/test/test/lux/macro/poly/equivalence.lux @@ -49,7 +49,7 @@ (r.Random Record) (do r.Monad [size (:: @ map (n/% |2) r.nat) - #let [gen-int (|> r.int (:: @ map (|>> int/abs (i/% 1_000_000))))]] + #let [gen-int (|> r.int (:: @ map (|>> int/abs (i/% +1_000_000))))]] ($_ r.and r.bit gen-int diff --git a/stdlib/test/test/lux/macro/syntax.lux b/stdlib/test/test/lux/macro/syntax.lux index 4f6a29a05..63d592251 100644 --- a/stdlib/test/test/lux/macro/syntax.lux +++ b/stdlib/test/test/lux/macro/syntax.lux @@ -74,9 +74,9 @@ ["Can parse Bit syntax." #1 code.bit bit.Equivalence s.bit] ["Can parse Nat syntax." |123 code.nat number.Equivalence s.nat] - ["Can parse Int syntax." 123 code.int number.Equivalence s.int] + ["Can parse Int syntax." +123 code.int number.Equivalence s.int] ["Can parse Rev syntax." .123 code.rev number.Equivalence s.rev] - ["Can parse Frac syntax." 123.0 code.frac number.Equivalence s.frac] + ["Can parse Frac syntax." +123.0 code.frac number.Equivalence s.frac] ["Can parse Text syntax." "\n" code.text text.Equivalence s.text] ["Can parse Identifier syntax." ["yolo" "lol"] code.identifier name.Equivalence s.identifier] ["Can parse Tag syntax." ["yolo" "lol"] code.tag name.Equivalence s.tag] @@ -103,21 +103,21 @@ (with-expansions [ (do-template [ ] [(test (format "Can parse " " syntax.") - (and (match [#1 123] - (p.run (list ( (list (code.bit #1) (code.int 123)))) + (and (match [#1 +123] + (p.run (list ( (list (code.bit #1) (code.int +123)))) ( (p.and s.bit s.int)))) (match #1 (p.run (list ( (list (code.bit #1)))) ( s.bit))) - (fails? (p.run (list ( (list (code.bit #1) (code.int 123)))) + (fails? (p.run (list ( (list (code.bit #1) (code.int +123)))) ( s.bit))) (match (#.Left #1) (p.run (list ( (list (code.bit #1)))) ( (p.or s.bit s.int)))) - (match (#.Right 123) - (p.run (list ( (list (code.int 123)))) + (match (#.Right +123) + (p.run (list ( (list (code.int +123)))) ( (p.or s.bit s.int)))) - (fails? (p.run (list ( (list (code.frac 123.0)))) + (fails? (p.run (list ( (list (code.frac +123.0)))) ( (p.or s.bit s.int))))))] ["form" s.form code.form] @@ -126,8 +126,8 @@ (test "Can parse record syntax." - (match [#1 123] - (p.run (list (code.record (list [(code.bit #1) (code.int 123)]))) + (match [#1 +123] + (p.run (list (code.record (list [(code.bit #1) (code.int +123)]))) (s.record (p.and s.bit s.int))))) ))) @@ -135,7 +135,7 @@ ($_ seq (test "Can parse any Code." (match [_ (#.Bit #1)] - (p.run (list (code.bit #1) (code.int 123)) + (p.run (list (code.bit #1) (code.int +123)) s.any))) (test "Can check whether the end has been reached." diff --git a/stdlib/test/test/lux/math.lux b/stdlib/test/test/lux/math.lux index eb086243f..83ed1f8b0 100644 --- a/stdlib/test/test/lux/math.lux +++ b/stdlib/test/test/lux/math.lux @@ -14,7 +14,7 @@ (f/< margin-of-error (frac/abs (f/- standard value)))) -(def: margin Frac 0.0000001) +(def: margin Frac +0.0000001) (def: (trigonometric-symmetry forward backward angle) (-> (-> Frac Frac) (-> Frac Frac) Frac Bit) @@ -39,32 +39,32 @@ (context: "Rounding" (<| (times |100) (do @ - [sample (|> r.frac (:: @ map (f/* 1000.0)))] + [sample (|> r.frac (:: @ map (f/* +1000.0)))] ($_ seq (test "The ceiling will be an integer value, and will be >= the original." (let [ceil'd (&.ceil sample)] (and (|> ceil'd frac-to-int int-to-frac (f/= ceil'd)) (f/>= sample ceil'd) - (f/<= 1.0 (f/- sample ceil'd))))) + (f/<= +1.0 (f/- sample ceil'd))))) (test "The floor will be an integer value, and will be <= the original." (let [floor'd (&.floor sample)] (and (|> floor'd frac-to-int int-to-frac (f/= floor'd)) (f/<= sample floor'd) - (f/<= 1.0 (f/- floor'd sample))))) + (f/<= +1.0 (f/- floor'd sample))))) (test "The round will be an integer value, and will be < or > or = the original." (let [round'd (&.round sample)] (and (|> round'd frac-to-int int-to-frac (f/= round'd)) - (f/<= 1.0 (frac/abs (f/- sample round'd)))))) + (f/<= +1.0 (frac/abs (f/- sample round'd)))))) )))) (context: "Exponentials and logarithms" (<| (times |100) (do @ - [sample (|> r.frac (:: @ map (f/* 10.0)))] + [sample (|> r.frac (:: @ map (f/* +10.0)))] (test "Logarithm is the inverse of exponential." - (|> sample &.exp &.log (within? 1.0e-15 sample)))))) + (|> sample &.exp &.log (within? +1.0e-15 sample)))))) (context: "Greatest-Common-Divisor and Least-Common-Multiple" (<| (times |100) diff --git a/stdlib/test/test/lux/math/modular.lux b/stdlib/test/test/lux/math/modular.lux index 4d4ae3d8d..43f7d178e 100644 --- a/stdlib/test/test/lux/math/modular.lux +++ b/stdlib/test/test/lux/math/modular.lux @@ -14,18 +14,18 @@ [type ("type/." Equivalence)]] lux/test) -(def: %3 (/.modulus 3)) +(def: %3 (/.modulus +3)) (`` (type: Mod3 (~~ (:of %3)))) (def: modulusR (r.Random Int) (|> r.int - (:: r.Monad map (i/% 1000)) - (r.filter (|>> (i/= 0) not)))) + (:: r.Monad map (i/% +1000)) + (r.filter (|>> (i/= +0) not)))) (def: valueR (r.Random Int) - (|> r.int (:: r.Monad map (i/% 1000)))) + (|> r.int (:: r.Monad map (i/% +1000)))) (def: (modR modulus) (All [m] (-> (/.Modulus m) (r.Random [Int (/.Mod m)]))) @@ -109,7 +109,7 @@ (#.Some subject^-1) (|> subject (/.m/* subject^-1) - (/.m/= (/.mod normalM 1))) + (/.m/= (/.mod normalM +1))) #.None #1)) diff --git a/stdlib/test/test/lux/time/duration.lux b/stdlib/test/test/lux/time/duration.lux index 01ca9c98e..0f8c9f553 100644 --- a/stdlib/test/test/lux/time/duration.lux +++ b/stdlib/test/test/lux/time/duration.lux @@ -47,13 +47,13 @@ (do @ [sample (|> duration (:: @ map (@.frame @.day))) frame duration - factor (|> r.int (:: @ map (|>> (i/% 10) (i/max 1)))) + factor (|> r.int (:: @ map (|>> (i/% +10) (i/max +1)))) #let [(^open "@/.") @.Order]] ($_ seq (test "Can scale a duration." (|> sample (@.scale factor) (@.query sample) (i/= factor))) (test "Scaling a duration by one does not change it." - (|> sample (@.scale 1) (@/= sample))) + (|> sample (@.scale +1) (@/= sample))) (test "Merging with the empty duration changes nothing." (|> sample (@.merge @.empty) (@/= sample))) (test "Merging a duration with it's opposite yields an empty duration." diff --git a/stdlib/test/test/lux/time/instant.lux b/stdlib/test/test/lux/time/instant.lux index 59c01019e..db4898e20 100644 --- a/stdlib/test/test/lux/time/instant.lux +++ b/stdlib/test/test/lux/time/instant.lux @@ -18,7 +18,7 @@ [// ["_." duration]]) -(def: boundary Int 99_999_999_999_999) +(def: boundary Int +99_999_999_999_999) (def: #export instant (r.Random @.Instant) diff --git a/stdlib/test/test/lux/world/file.lux b/stdlib/test/test/lux/world/file.lux index cadc242e6..857b6afb5 100644 --- a/stdlib/test/test/lux/world/file.lux +++ b/stdlib/test/test/lux/world/file.lux @@ -23,7 +23,7 @@ ["_." binary]]) (def: truncate-millis - (|>> (i// 1_000) (i/* 1_000))) + (|>> (i// +1_000) (i/* +1_000))) (context: "File system." (do @ @@ -158,8 +158,8 @@ (assert "Can change the time of last modification." (error.default #0 result)))) (wrap (do promise.Monad - [#let [file0 (format "temp_file_" (%n (n/+ |9 code)) "0") - file1 (format "temp_file_" (%n (n/+ |9 code)) "1")] + [#let [file0 (format "temp_file_" (%n (n/+ |9 code)) "+0") + file1 (format "temp_file_" (%n (n/+ |9 code)) "+1")] result (promise.future (do (:: @.JVM@System &monad) [_ (:: @.JVM@System write dataL file0) -- cgit v1.2.3