diff options
Diffstat (limited to '')
47 files changed, 210 insertions, 224 deletions
diff --git a/stdlib/source/test/lux/data.lux b/stdlib/source/test/lux/data.lux index 78cae485a..376a7cd3e 100644 --- a/stdlib/source/test/lux/data.lux +++ b/stdlib/source/test/lux/data.lux @@ -12,7 +12,6 @@ ["#." lazy] ["#." maybe] ["#." name] - ["#." number] ["#." product] ["#." sum] ["#." color @@ -53,7 +52,6 @@ /lazy.test /maybe.test /name.test - /number.test /product.test) test2 ($_ _.and /sum.test diff --git a/stdlib/source/test/lux/data/binary.lux b/stdlib/source/test/lux/data/binary.lux index 3d828dbb2..07c02ea09 100644 --- a/stdlib/source/test/lux/data/binary.lux +++ b/stdlib/source/test/lux/data/binary.lux @@ -1,8 +1,6 @@ (.module: [lux #* ["_" test (#+ Test)] - [math - ["." random (#+ Random)]] [abstract ["." monad (#+ do)] ["." enum] @@ -14,11 +12,13 @@ ["." try (#+ Try)] ["." exception (#+ Exception)]] [data + [collection + ["." list]]] + [math + ["." random (#+ Random)] [number ["." i64] - ["n" nat]] - [collection - ["." list]]]] + ["n" nat]]]] {1 ["." / (#+ Binary)]}) diff --git a/stdlib/source/test/lux/data/collection/array.lux b/stdlib/source/test/lux/data/collection/array.lux index ab1b1f04c..5cfbe4a7d 100644 --- a/stdlib/source/test/lux/data/collection/array.lux +++ b/stdlib/source/test/lux/data/collection/array.lux @@ -12,15 +12,14 @@ [data ["." bit] ["." maybe] - ["." text ("#\." equivalence) - ["%" format (#+ format)]] - [number - ["n" nat]] + ["." text ("#\." equivalence)] [collection ["." list] ["." set]]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat]]]] {1 ["." / (#+ Array)]}) diff --git a/stdlib/source/test/lux/data/collection/bits.lux b/stdlib/source/test/lux/data/collection/bits.lux index 6e07dc2e6..f4b780864 100644 --- a/stdlib/source/test/lux/data/collection/bits.lux +++ b/stdlib/source/test/lux/data/collection/bits.lux @@ -7,11 +7,10 @@ {[0 #spec] [/ ["$." equivalence]]}] - [data - [number - ["n" nat]]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat]]]] {1 ["." / (#+ Bits)]}) diff --git a/stdlib/source/test/lux/data/collection/dictionary.lux b/stdlib/source/test/lux/data/collection/dictionary.lux index 0de661e64..92705210b 100644 --- a/stdlib/source/test/lux/data/collection/dictionary.lux +++ b/stdlib/source/test/lux/data/collection/dictionary.lux @@ -14,12 +14,12 @@ [data ["." product] ["." maybe] - [number - ["n" nat]] [collection ["." list ("#\." functor)]]] [math - ["." random]]] + ["." random] + [number + ["n" nat]]]] {1 ["." /]}) diff --git a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux index a44b5c295..778726329 100644 --- a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux +++ b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux @@ -12,13 +12,13 @@ ["." product] ["." bit ("#\." equivalence)] ["." maybe ("#\." monad)] - [number - ["n" nat]] [collection ["." set] ["." list ("#\." functor)]]] [math - ["." random (#+ Random) ("#\." monad)]]] + ["." random (#+ Random) ("#\." monad)] + [number + ["n" nat]]]] {1 ["." /]}) diff --git a/stdlib/source/test/lux/data/collection/dictionary/plist.lux b/stdlib/source/test/lux/data/collection/dictionary/plist.lux index 753b8db8a..7473aec04 100644 --- a/stdlib/source/test/lux/data/collection/dictionary/plist.lux +++ b/stdlib/source/test/lux/data/collection/dictionary/plist.lux @@ -10,13 +10,13 @@ ["." bit ("#\." equivalence)] ["." maybe ("#\." monad)] ["." text] - [number - ["n" nat]] [collection ["." set] ["." list]]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat]]]] {1 ["." /]}) diff --git a/stdlib/source/test/lux/data/collection/list.lux b/stdlib/source/test/lux/data/collection/list.lux index b2d35b1f4..6306f62fc 100644 --- a/stdlib/source/test/lux/data/collection/list.lux +++ b/stdlib/source/test/lux/data/collection/list.lux @@ -21,13 +21,13 @@ ["." product] ["." maybe] ["." text ("#\." equivalence)] - [number - ["n" nat] - ["." int]] [collection ["." set]]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat] + ["." int]]]] {1 ["." / ("#\." monad)]}) diff --git a/stdlib/source/test/lux/data/collection/queue.lux b/stdlib/source/test/lux/data/collection/queue.lux index 3e532a66e..b246f8187 100644 --- a/stdlib/source/test/lux/data/collection/queue.lux +++ b/stdlib/source/test/lux/data/collection/queue.lux @@ -9,14 +9,13 @@ ["$." functor (#+ Injection)]]}] [data ["." bit ("#\." equivalence)] - ["%" text/format (#+ format)] - [number - ["n" nat]] [collection ["." set] ["." list ("#\." monoid)]]] [math - ["." random]]] + ["." random] + [number + ["n" nat]]]] {1 ["." /]}) diff --git a/stdlib/source/test/lux/data/collection/queue/priority.lux b/stdlib/source/test/lux/data/collection/queue/priority.lux index 19f219378..4e99d2a3a 100644 --- a/stdlib/source/test/lux/data/collection/queue/priority.lux +++ b/stdlib/source/test/lux/data/collection/queue/priority.lux @@ -5,11 +5,11 @@ ["." monad (#+ do)]] [data ["." maybe ("#\." functor)] - ["." bit ("#\." equivalence)] - [number - ["n" nat]]] + ["." bit ("#\." equivalence)]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat]]]] {1 ["." / (#+ Queue)]}) diff --git a/stdlib/source/test/lux/data/collection/row.lux b/stdlib/source/test/lux/data/collection/row.lux index 13ed9af28..55d9492ff 100644 --- a/stdlib/source/test/lux/data/collection/row.lux +++ b/stdlib/source/test/lux/data/collection/row.lux @@ -16,13 +16,13 @@ ["." exception]] [data ["." bit ("#\." equivalence)] - [number - ["n" nat]] [collection ["." list ("#\." fold)] ["." set]]] [math - ["." random]]] + ["." random] + [number + ["n" nat]]]] {1 ["." / ("#\." monad)]}) diff --git a/stdlib/source/test/lux/data/collection/sequence.lux b/stdlib/source/test/lux/data/collection/sequence.lux index b97e1f7d2..013936731 100644 --- a/stdlib/source/test/lux/data/collection/sequence.lux +++ b/stdlib/source/test/lux/data/collection/sequence.lux @@ -10,14 +10,14 @@ ["$." functor] ["$." comonad]]}] [data - [number - ["n" nat]] ["." text ["%" format (#+ format)]] [collection ["." list ("#\." functor)]]] [math - ["." random]]] + ["." random] + [number + ["n" nat]]]] {1 ["." /]}) diff --git a/stdlib/source/test/lux/data/collection/set.lux b/stdlib/source/test/lux/data/collection/set.lux index a58627cde..6f981af91 100644 --- a/stdlib/source/test/lux/data/collection/set.lux +++ b/stdlib/source/test/lux/data/collection/set.lux @@ -10,12 +10,12 @@ ["$." monoid]]}] [data ["." bit ("#\." equivalence)] - [number - ["n" nat]] [collection ["." list]]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat]]]] {1 ["." / ("\." equivalence)]}) diff --git a/stdlib/source/test/lux/data/collection/set/multi.lux b/stdlib/source/test/lux/data/collection/set/multi.lux index 8d6d5aa22..9d9572795 100644 --- a/stdlib/source/test/lux/data/collection/set/multi.lux +++ b/stdlib/source/test/lux/data/collection/set/multi.lux @@ -10,13 +10,13 @@ ["$." equivalence]]}] [data ["." bit ("#\." equivalence)] - [number - ["n" nat]] [collection ["." set] ["." list ("#\." fold)]]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat]]]] {1 ["." /]}) diff --git a/stdlib/source/test/lux/data/collection/set/ordered.lux b/stdlib/source/test/lux/data/collection/set/ordered.lux index 6c0e75b3d..daf924012 100644 --- a/stdlib/source/test/lux/data/collection/set/ordered.lux +++ b/stdlib/source/test/lux/data/collection/set/ordered.lux @@ -9,12 +9,12 @@ ["$." equivalence]]}] [data ["." bit ("#\." equivalence)] - [number - ["n" nat]] [collection ["." list]]] [math - ["." random (#+ Random) ("#\." monad)]]] + ["." random (#+ Random) ("#\." monad)] + [number + ["n" nat]]]] {1 ["." / (#+ Set) ["." //]]}) diff --git a/stdlib/source/test/lux/data/collection/stack.lux b/stdlib/source/test/lux/data/collection/stack.lux index 8a12c4fab..ae6fbabf6 100644 --- a/stdlib/source/test/lux/data/collection/stack.lux +++ b/stdlib/source/test/lux/data/collection/stack.lux @@ -9,11 +9,11 @@ ["$." functor (#+ Injection)]]}] [data ["." maybe] - ["." bit ("#\." equivalence)] - [number - ["n" nat]]] + ["." bit ("#\." equivalence)]] [math - ["." random]]] + ["." random] + [number + ["n" nat]]]] {1 ["." /]}) diff --git a/stdlib/source/test/lux/data/collection/tree.lux b/stdlib/source/test/lux/data/collection/tree.lux index 0b7dbbdf8..b7fea5e4f 100644 --- a/stdlib/source/test/lux/data/collection/tree.lux +++ b/stdlib/source/test/lux/data/collection/tree.lux @@ -10,12 +10,12 @@ ["$." functor]]}] [data ["." product] - [number - ["n" nat]] [collection ["." list ("#\." functor fold)]]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat]]]] {1 ["." / (#+ Tree)]}) diff --git a/stdlib/source/test/lux/data/collection/tree/finger.lux b/stdlib/source/test/lux/data/collection/tree/finger.lux index f169d8a5d..33b333396 100644 --- a/stdlib/source/test/lux/data/collection/tree/finger.lux +++ b/stdlib/source/test/lux/data/collection/tree/finger.lux @@ -6,12 +6,12 @@ [data ["." maybe ("#\." functor)] ["." text ("#\." equivalence monoid)] - [number - ["n" nat]] [collection ["." list ("#\." fold)]]] [math - ["." random]] + ["." random] + [number + ["n" nat]]] [type (#+ :by_example)]] {1 ["." /]}) diff --git a/stdlib/source/test/lux/data/collection/tree/zipper.lux b/stdlib/source/test/lux/data/collection/tree/zipper.lux index 419935101..929572a37 100644 --- a/stdlib/source/test/lux/data/collection/tree/zipper.lux +++ b/stdlib/source/test/lux/data/collection/tree/zipper.lux @@ -14,12 +14,12 @@ ["." product] ["." maybe ("#\." functor)] ["." text] - [number - ["n" nat]] [collection ["." list]]] [math - ["." random]]] + ["." random] + [number + ["n" nat]]]] ["." //] {1 ["." / (#+ Zipper) diff --git a/stdlib/source/test/lux/data/color.lux b/stdlib/source/test/lux/data/color.lux index c0ea5e699..a8119145b 100644 --- a/stdlib/source/test/lux/data/color.lux +++ b/stdlib/source/test/lux/data/color.lux @@ -9,17 +9,17 @@ ["$." hash] ["$." monoid]]}] [data - [number - ["n" nat] - ["." int] - ["f" frac] - ["r" rev]] [collection ["." list]]] [macro ["." template]] ["." math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat] + ["." int] + ["f" frac] + ["r" rev]]]] {1 ["." / (#+ Color)]}) diff --git a/stdlib/source/test/lux/data/color/named.lux b/stdlib/source/test/lux/data/color/named.lux index 062ba560b..9a3fddcaf 100644 --- a/stdlib/source/test/lux/data/color/named.lux +++ b/stdlib/source/test/lux/data/color/named.lux @@ -4,15 +4,15 @@ [abstract [monad (#+ do)]] [data - [number - ["n" nat]] [collection ["." list] ["." set]]] [macro ["." template]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat]]]] {1 ["." / ["/#" //]]}) diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux index 2d38b8988..4f14375d9 100644 --- a/stdlib/source/test/lux/data/format/json.lux +++ b/stdlib/source/test/lux/data/format/json.lux @@ -15,16 +15,16 @@ ["." bit] ["." text ["%" format (#+ format)]] - [number - ["n" nat] - ["." frac]] [collection ["." row] ["." dictionary] ["." set] ["." list ("#\." functor)]]] [math - ["." random (#+ Random)]] + ["." random (#+ Random)] + [number + ["n" nat] + ["." frac]]] [macro ["." syntax (#+ syntax:)] ["." code]]] diff --git a/stdlib/source/test/lux/data/format/tar.lux b/stdlib/source/test/lux/data/format/tar.lux index 72024ba29..9d576b93a 100644 --- a/stdlib/source/test/lux/data/format/tar.lux +++ b/stdlib/source/test/lux/data/format/tar.lux @@ -18,9 +18,6 @@ ["." unicode #_ ["#" set] ["#/." block]]] - [number - ["n" nat] - ["i" int]] [collection ["." row] ["." list ("#\." fold)]] @@ -30,7 +27,10 @@ ["." instant (#+ Instant)] ["." duration]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat] + ["i" int]]]] {1 ["." /]}) diff --git a/stdlib/source/test/lux/data/format/xml.lux b/stdlib/source/test/lux/data/format/xml.lux index 57958281c..bd3b45216 100644 --- a/stdlib/source/test/lux/data/format/xml.lux +++ b/stdlib/source/test/lux/data/format/xml.lux @@ -17,13 +17,13 @@ ["." maybe] ["." text ("#\." equivalence) ["%" format (#+ format)]] - [number - ["n" nat]] [collection ["." dictionary] ["." list ("#\." functor)]]] [math - ["." random (#+ Random) ("#\." monad)]]] + ["." random (#+ Random) ("#\." monad)] + [number + ["n" nat]]]] {1 ["." / (#+ XML)]}) diff --git a/stdlib/source/test/lux/data/lazy.lux b/stdlib/source/test/lux/data/lazy.lux index ddb24aee8..5900817e4 100644 --- a/stdlib/source/test/lux/data/lazy.lux +++ b/stdlib/source/test/lux/data/lazy.lux @@ -9,11 +9,10 @@ ["$." apply] ["$." monad] ["$." equivalence]]}] - [data - [number - ["n" nat]]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat]]]] {1 ["." / (#+ Lazy)]}) diff --git a/stdlib/source/test/lux/data/maybe.lux b/stdlib/source/test/lux/data/maybe.lux index f5e965614..64f9b5ff5 100644 --- a/stdlib/source/test/lux/data/maybe.lux +++ b/stdlib/source/test/lux/data/maybe.lux @@ -15,63 +15,63 @@ pipe] [data ["." text] - [number - ["n" nat]] [collection ["." list]]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat]]]] {1 ["." / ("#\." monoid monad)]}) (def: #export test Test (<| (_.covering /._) - (_.for [.Maybe] - ($_ _.and - (_.for [/.equivalence] - ($equivalence.spec (/.equivalence n.equivalence) (random.maybe random.nat))) - (_.for [/.monoid] - ($monoid.spec (/.equivalence n.equivalence) /.monoid (random.maybe random.nat))) - (_.for [/.functor] - ($functor.spec /\wrap /.equivalence /.functor)) - (_.for [/.apply] - ($apply.spec /\wrap /.equivalence /.apply)) - (_.for [/.monad] - ($monad.spec /\wrap /.equivalence /.monad)) - - (do random.monad - [left random.nat - right random.nat - #let [expected (n.+ left right)]] - (let [lift (/.lift io.monad)] - (_.cover [/.with /.lift] - (|> (io.run (do (/.with io.monad) - [a (lift (io\wrap left)) - b (wrap right)] - (wrap (n.+ a b)))) - (case> (#.Some actual) - (n.= expected actual) + (_.for [.Maybe]) + ($_ _.and + (_.for [/.equivalence] + ($equivalence.spec (/.equivalence n.equivalence) (random.maybe random.nat))) + (_.for [/.monoid] + ($monoid.spec (/.equivalence n.equivalence) /.monoid (random.maybe random.nat))) + (_.for [/.functor] + ($functor.spec /\wrap /.equivalence /.functor)) + (_.for [/.apply] + ($apply.spec /\wrap /.equivalence /.apply)) + (_.for [/.monad] + ($monad.spec /\wrap /.equivalence /.monad)) + + (do random.monad + [left random.nat + right random.nat + #let [expected (n.+ left right)]] + (let [lift (/.lift io.monad)] + (_.cover [/.with /.lift] + (|> (io.run (do (/.with io.monad) + [a (lift (io\wrap left)) + b (wrap right)] + (wrap (n.+ a b)))) + (case> (#.Some actual) + (n.= expected actual) - _ - false))))) - (do random.monad - [default random.nat - value random.nat] - (_.cover [/.default] - (and (is? default (/.default default - #.None)) + _ + false))))) + (do random.monad + [default random.nat + value random.nat] + (_.cover [/.default] + (and (is? default (/.default default + #.None)) - (is? value (/.default default - (#.Some value)))))) - (do random.monad - [value random.nat] - (_.cover [/.assume] - (is? value (/.assume (#.Some value))))) - (do random.monad - [value random.nat] - (_.cover [/.to-list] - (\ (list.equivalence n.equivalence) = - (list value) - (/.to-list (#.Some value))))) - )))) + (is? value (/.default default + (#.Some value)))))) + (do random.monad + [value random.nat] + (_.cover [/.assume] + (is? value (/.assume (#.Some value))))) + (do random.monad + [value random.nat] + (_.cover [/.to-list] + (\ (list.equivalence n.equivalence) = + (list value) + (/.to-list (#.Some value))))) + ))) diff --git a/stdlib/source/test/lux/data/name.lux b/stdlib/source/test/lux/data/name.lux index 08fd3065e..7912994c3 100644 --- a/stdlib/source/test/lux/data/name.lux +++ b/stdlib/source/test/lux/data/name.lux @@ -11,11 +11,11 @@ [control pipe] [data - [number - ["n" nat]] ["." text ("#\." equivalence)]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat]]]] {1 ["." /]}) diff --git a/stdlib/source/test/lux/data/product.lux b/stdlib/source/test/lux/data/product.lux index 3c61091bb..c33e60dd1 100644 --- a/stdlib/source/test/lux/data/product.lux +++ b/stdlib/source/test/lux/data/product.lux @@ -6,12 +6,11 @@ {[0 #spec] [/ ["$." equivalence]]}] - [data + [math + ["." random] [number ["n" nat] - ["i" int]]] - [math - ["." random]]] + ["i" int]]]] {1 ["." /]}) diff --git a/stdlib/source/test/lux/data/sum.lux b/stdlib/source/test/lux/data/sum.lux index 7fbf816a1..da108ede8 100644 --- a/stdlib/source/test/lux/data/sum.lux +++ b/stdlib/source/test/lux/data/sum.lux @@ -10,13 +10,13 @@ pipe] [data ["." text] - [number - ["n" nat] - ["i" int]] [collection ["." list ("#\." functor)]]] [math - ["." random]]] + ["." random] + [number + ["n" nat] + ["i" int]]]] {1 ["." /]}) diff --git a/stdlib/source/test/lux/data/text.lux b/stdlib/source/test/lux/data/text.lux index 4100d5f0d..4308f8e95 100644 --- a/stdlib/source/test/lux/data/text.lux +++ b/stdlib/source/test/lux/data/text.lux @@ -12,13 +12,13 @@ pipe] [data ["." maybe] - [number - ["n" nat]] [collection ["." list] ["." set]]] [math - ["." random]]] + ["." random] + [number + ["n" nat]]]] ["." / #_ ["#." buffer] ["#." encoding] diff --git a/stdlib/source/test/lux/data/text/buffer.lux b/stdlib/source/test/lux/data/text/buffer.lux index a12d57fc5..852a3c951 100644 --- a/stdlib/source/test/lux/data/text/buffer.lux +++ b/stdlib/source/test/lux/data/text/buffer.lux @@ -5,11 +5,11 @@ [monad (#+ do)]] [data ["." text ("#\." equivalence) - ["%" format (#+ format)]] - [number - ["n" nat]]] + ["%" format (#+ format)]]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat]]]] {1 ["." /]}) diff --git a/stdlib/source/test/lux/data/text/encoding.lux b/stdlib/source/test/lux/data/text/encoding.lux index 2e61159dc..c5b985f50 100644 --- a/stdlib/source/test/lux/data/text/encoding.lux +++ b/stdlib/source/test/lux/data/text/encoding.lux @@ -11,15 +11,15 @@ [data ["." maybe] ["." text ("#\." equivalence)] - [number - ["n" nat]] [collection ["." list ("#\." functor)] ["." set]]] [macro ["." template]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat]]]] {1 ["." /]}) diff --git a/stdlib/source/test/lux/data/text/format.lux b/stdlib/source/test/lux/data/text/format.lux index 00df7058a..2aa33d2d4 100644 --- a/stdlib/source/test/lux/data/text/format.lux +++ b/stdlib/source/test/lux/data/text/format.lux @@ -14,12 +14,6 @@ ["." text ("#\." equivalence)] ["." bit] ["." name] - [number - ["." nat] - ["." int] - ["." rev] - ["." frac] - ["." ratio]] [format ["." xml] ["." json]] @@ -32,7 +26,13 @@ [math ["." random (#+ Random) ("#\." monad)] ["." modulus] - ["." modular]] + ["." modular] + [number + ["." nat] + ["." int] + ["." rev] + ["." frac] + ["." ratio]]] [macro ["." code]] [meta diff --git a/stdlib/source/test/lux/data/text/regex.lux b/stdlib/source/test/lux/data/text/regex.lux index 3998f78f7..2cdead181 100644 --- a/stdlib/source/test/lux/data/text/regex.lux +++ b/stdlib/source/test/lux/data/text/regex.lux @@ -10,10 +10,10 @@ ["<.>" text (#+ Parser)] ["s" code]]] [data - [number (#+ hex)] ["." text ("#\." equivalence) ["%" format (#+ format)]]] [math + [number (#+ hex)] ["." random]] ["." meta] [macro @@ -53,13 +53,13 @@ (syntax: (should_check pattern regex input) (meta.with_gensyms [g!message g!_] - (wrap (list (` (|> (~ input) - (<text>.run (~ regex)) - (case> (^ (#try.Success (~ pattern))) - true + (wrap (list (` (|> (~ input) + (<text>.run (~ regex)) + (case> (^ (#try.Success (~ pattern))) + true - (~ g!_) - false))))))) + (~ g!_) + false))))))) (def: basics Test diff --git a/stdlib/source/test/lux/data/text/unicode/block.lux b/stdlib/source/test/lux/data/text/unicode/block.lux index a575b4fc6..316bbe516 100644 --- a/stdlib/source/test/lux/data/text/unicode/block.lux +++ b/stdlib/source/test/lux/data/text/unicode/block.lux @@ -10,15 +10,15 @@ ["$." monoid]]}] [data ["." text] - [number (#+ hex) - ["n" nat]] [collection ["." set] ["." list]]] [macro ["." template]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number (#+ hex) + ["n" nat]]]] {1 ["." /]}) diff --git a/stdlib/source/test/lux/data/text/unicode/set.lux b/stdlib/source/test/lux/data/text/unicode/set.lux index e32c08bfd..a219bff51 100644 --- a/stdlib/source/test/lux/data/text/unicode/set.lux +++ b/stdlib/source/test/lux/data/text/unicode/set.lux @@ -9,12 +9,12 @@ [data ["." product] ["." bit ("#\." equivalence)] - [number - ["n" nat]] [collection ["." set ("#\." equivalence)]]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)] + [number + ["n" nat]]]] ["." / #_ ["/#" // #_ ["#." block]]] diff --git a/stdlib/source/test/lux/data/number.lux b/stdlib/source/test/lux/math/number.lux index d8e769369..5a897db71 100644 --- a/stdlib/source/test/lux/data/number.lux +++ b/stdlib/source/test/lux/math/number.lux @@ -4,15 +4,13 @@ [control ["." try]] [data - ["." text - ["%" format (#+ format)]] - [number - ["n" nat] - ["i" int] - ["r" rev] - ["f" frac]]]] + ["." text]]] {1 - ["." /]} + ["." / + ["n" nat] + ["i" int] + ["r" rev] + ["f" frac]]} ["." / #_ ["#." i8] ["#." i16] diff --git a/stdlib/source/test/lux/data/number/complex.lux b/stdlib/source/test/lux/math/number/complex.lux index fc83ddb51..751ec9022 100644 --- a/stdlib/source/test/lux/data/number/complex.lux +++ b/stdlib/source/test/lux/math/number/complex.lux @@ -10,17 +10,18 @@ ["$." order] ["$." codec]]}] [data - [number - ["n" nat] - ["." int] - ["f" frac]] [collection ["." list ("#\." functor)]]] ["." math ["." random (#+ Random)]]] {1 - ["." /]}) + ["." / + [// + ["n" nat] + ["f" frac] + ["." int]]]}) +## This margin of error is necessary because floating-point arithmetic is not exact. (def: margin_of_error +0.000000001) diff --git a/stdlib/source/test/lux/data/number/frac.lux b/stdlib/source/test/lux/math/number/frac.lux index dcaa417ed..dcaa417ed 100644 --- a/stdlib/source/test/lux/data/number/frac.lux +++ b/stdlib/source/test/lux/math/number/frac.lux diff --git a/stdlib/source/test/lux/data/number/i16.lux b/stdlib/source/test/lux/math/number/i16.lux index 1a5009a03..6cf457989 100644 --- a/stdlib/source/test/lux/data/number/i16.lux +++ b/stdlib/source/test/lux/math/number/i16.lux @@ -6,14 +6,12 @@ {[0 #spec] [/ ["$." equivalence]]}] - [data - [number - ["i" int]]] [math ["." random (#+ Random)]]] {1 ["." / ["/#" // #_ + ["i" int] ["#." i64]]]}) (def: #export random diff --git a/stdlib/source/test/lux/data/number/i32.lux b/stdlib/source/test/lux/math/number/i32.lux index fd48509ea..1061cdc1b 100644 --- a/stdlib/source/test/lux/data/number/i32.lux +++ b/stdlib/source/test/lux/math/number/i32.lux @@ -6,14 +6,12 @@ {[0 #spec] [/ ["$." equivalence]]}] - [data - [number - ["i" int]]] [math ["." random (#+ Random)]]] {1 ["." / ["/#" // #_ + ["i" int] ["#." i64]]]}) (def: #export random diff --git a/stdlib/source/test/lux/data/number/i64.lux b/stdlib/source/test/lux/math/number/i64.lux index 45e644ab2..43e240675 100644 --- a/stdlib/source/test/lux/data/number/i64.lux +++ b/stdlib/source/test/lux/math/number/i64.lux @@ -2,10 +2,7 @@ [lux #* ["_" test (#+ Test)] [data - ["." bit ("#\." equivalence)] - [number (#+ hex) - ["n" nat] - ["i" int]]] + ["." bit ("#\." equivalence)]] [abstract [monad (#+ do)] {[0 #spec] @@ -16,7 +13,10 @@ [math ["." random (#+ Random)]]] {1 - ["." / ("\." equivalence)]}) + ["." / ("\." equivalence) + [// (#+ hex) + ["n" nat] + ["i" int]]]}) (def: bit Test diff --git a/stdlib/source/test/lux/data/number/i8.lux b/stdlib/source/test/lux/math/number/i8.lux index 49b6995e8..b0903a903 100644 --- a/stdlib/source/test/lux/data/number/i8.lux +++ b/stdlib/source/test/lux/math/number/i8.lux @@ -6,14 +6,12 @@ {[0 #spec] [/ ["$." equivalence]]}] - [data - [number - ["i" int]]] [math ["." random (#+ Random)]]] {1 ["." / ["/#" // #_ + ["i" int] ["#." i64]]]}) (def: #export random diff --git a/stdlib/source/test/lux/data/number/int.lux b/stdlib/source/test/lux/math/number/int.lux index 24155602b..3d9931ad1 100644 --- a/stdlib/source/test/lux/data/number/int.lux +++ b/stdlib/source/test/lux/math/number/int.lux @@ -13,13 +13,13 @@ ["$." monoid] ["$." codec]]}] [data - ["." bit ("#\." equivalence)] - [number - ["f" frac]]] + ["." bit ("#\." equivalence)]] [math ["." random (#+ Random)]]] {1 - ["." /]}) + ["." / + [// + ["f" frac]]]}) (def: signature Test diff --git a/stdlib/source/test/lux/data/number/nat.lux b/stdlib/source/test/lux/math/number/nat.lux index a2d0fd655..3de2970cc 100644 --- a/stdlib/source/test/lux/data/number/nat.lux +++ b/stdlib/source/test/lux/math/number/nat.lux @@ -13,13 +13,13 @@ ["$." monoid] ["$." codec]]}] [data - ["." bit ("#\." equivalence)] - [number - ["f" frac]]] + ["." bit ("#\." equivalence)]] [math ["." random]]] {1 - ["." /]}) + ["." / + [// + ["f" frac]]]}) (def: signature Test diff --git a/stdlib/source/test/lux/data/number/ratio.lux b/stdlib/source/test/lux/math/number/ratio.lux index 1e8da2e78..199096dab 100644 --- a/stdlib/source/test/lux/data/number/ratio.lux +++ b/stdlib/source/test/lux/math/number/ratio.lux @@ -11,13 +11,13 @@ ["$." codec]]}] [data ["." bit ("#\." equivalence)] - ["." maybe ("#\." functor)] - [number - ["n" nat ("#\." equivalence)]]] + ["." maybe ("#\." functor)]] [math ["." random (#+ Random)]]] {1 - ["." /]}) + ["." / + [// + ["n" nat ("#\." equivalence)]]]}) (def: part (Random Nat) diff --git a/stdlib/source/test/lux/data/number/rev.lux b/stdlib/source/test/lux/math/number/rev.lux index 2e75eb874..5b30741df 100644 --- a/stdlib/source/test/lux/data/number/rev.lux +++ b/stdlib/source/test/lux/math/number/rev.lux @@ -13,15 +13,15 @@ ["$." monoid] ["$." codec]]}] [data - ["." bit ("#\." equivalence)] - [number (#+ hex) - ["n" nat] - ["f" frac] - ["." i64 ("#\." hash)]]] + ["." bit ("#\." equivalence)]] [math ["." random]]] {1 - ["." /]}) + ["." / + [// (#+ hex) + ["n" nat] + ["f" frac] + ["." i64 ("#\." hash)]]]}) (def: signature Test |