aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/world
diff options
context:
space:
mode:
authorEduardo Julian2022-07-28 17:39:01 -0400
committerEduardo Julian2022-07-28 17:39:01 -0400
commita4b64bf1cdf47160b6b615d2c6493039abfd7a94 (patch)
tree3fe8c149d9cad89bbf067c736d196260203d1a01 /stdlib/source/test/lux/world
parenta4847190df926d35f7ece97da50a2a8b1462a24f (diff)
Extracted unit-testing machinery into its own module.
Diffstat (limited to 'stdlib/source/test/lux/world')
-rw-r--r--stdlib/source/test/lux/world/file.lux11
-rw-r--r--stdlib/source/test/lux/world/file/watch.lux11
-rw-r--r--stdlib/source/test/lux/world/net/http/client.lux7
-rw-r--r--stdlib/source/test/lux/world/shell.lux7
4 files changed, 20 insertions, 16 deletions
diff --git a/stdlib/source/test/lux/world/file.lux b/stdlib/source/test/lux/world/file.lux
index faebedb1f..ff12cb791 100644
--- a/stdlib/source/test/lux/world/file.lux
+++ b/stdlib/source/test/lux/world/file.lux
@@ -1,7 +1,6 @@
(.require
[library
[lux (.except)
- ["_" test (.only Test)]
[abstract
["[0]" monad (.only do)]]
[control
@@ -24,7 +23,9 @@
["^" pattern]]]
[world
[time
- ["[0]" instant (.only Instant)]]]]]
+ ["[0]" instant (.only Instant)]]]
+ ["_" test (.only Test)
+ ["[0]" unit]]]]
["[0]" /
["[1][0]" watch]]
[\\library
@@ -255,7 +256,7 @@
(in (do async.monad
[.let [fs (/.mock /)]
? (at fs delete file)]
- (_.coverage' [/.cannot_delete]
+ (unit.coverage [/.cannot_delete]
(case ?
{try.#Failure error}
(exception.match? /.cannot_delete error)
@@ -265,7 +266,7 @@
(in (do async.monad
[.let [fs (/.mock /)]
? (at fs read file)]
- (_.coverage' [/.cannot_find_file]
+ (unit.coverage [/.cannot_find_file]
(case ?
{try.#Failure error}
(exception.match? /.cannot_find_file error)
@@ -276,7 +277,7 @@
[.let [fs (/.mock /)]
?/0 (at fs directory_files file)
?/1 (at fs sub_directories file)]
- (_.coverage' [/.cannot_find_directory]
+ (unit.coverage [/.cannot_find_directory]
(case [?/0 ?/1]
[{try.#Failure error/0} {try.#Failure error/1}]
(and (exception.match? /.cannot_find_directory error/0)
diff --git a/stdlib/source/test/lux/world/file/watch.lux b/stdlib/source/test/lux/world/file/watch.lux
index 9977934a0..a56fce833 100644
--- a/stdlib/source/test/lux/world/file/watch.lux
+++ b/stdlib/source/test/lux/world/file/watch.lux
@@ -1,7 +1,6 @@
(.require
[library
[lux (.except)
- ["_" test (.only Test)]
[abstract
[monad (.only do)]]
[control
@@ -18,7 +17,9 @@
[collection
["[0]" list]]]
[math
- ["[0]" random (.only Random) (.use "[1]#[0]" monad)]]]]
+ ["[0]" random (.only Random) (.use "[1]#[0]" monad)]]
+ ["_" test (.only Test)
+ ["[0]" unit]]]]
[\\library
["[0]" / (.only)
["/[1]" //]]]
@@ -74,7 +75,7 @@
(in (do async.monad
[?concern (at watcher concern directory)
?stop (at watcher stop directory)]
- (_.coverage' [/.not_being_watched]
+ (unit.coverage [/.not_being_watched]
(and (case ?concern
{try.#Failure error}
(exception.match? /.not_being_watched error)
@@ -182,7 +183,7 @@
after_creation!
after_modification!
after_deletion!)))]
- (_.coverage' [/.mock /.polling]
+ (unit.coverage [/.mock /.polling]
(try.else false verdict)))))
(do random.monad
[directory (random.alphabetic 5)
@@ -190,7 +191,7 @@
[fs watcher] (/.mock /)]]
(in (do async.monad
[started? (at watcher start /.all directory)]
- (_.coverage' [/.cannot_poll_a_non_existent_directory]
+ (unit.coverage [/.cannot_poll_a_non_existent_directory]
(case started?
{try.#Success _}
false
diff --git a/stdlib/source/test/lux/world/net/http/client.lux b/stdlib/source/test/lux/world/net/http/client.lux
index bd73d7e87..fcba904f9 100644
--- a/stdlib/source/test/lux/world/net/http/client.lux
+++ b/stdlib/source/test/lux/world/net/http/client.lux
@@ -1,7 +1,6 @@
(.require
[library
[lux (.except)
- ["_" test (.only Test)]
[abstract
[monad (.only Monad do)]]
[control
@@ -23,7 +22,9 @@
[math
["[0]" random (.only Random)]
[number
- ["[0]" nat]]]]]
+ ["[0]" nat]]]
+ ["_" test (.only Test)
+ ["[0]" unit]]]]
[\\library
["[0]" / (.only)
["/[1]" // (.only)
@@ -119,7 +120,7 @@
(verification ! <expected>))]
<cases>))]
- (_.coverage' [/.async]
+ (unit.coverage [/.async]
(and (,, (with_template [<definition> <expected>]
[<expected>]
diff --git a/stdlib/source/test/lux/world/shell.lux b/stdlib/source/test/lux/world/shell.lux
index 09126a8a3..0e3b16ce9 100644
--- a/stdlib/source/test/lux/world/shell.lux
+++ b/stdlib/source/test/lux/world/shell.lux
@@ -1,7 +1,6 @@
(.require
[library
[lux (.except)
- ["_" test (.only Test)]
[abstract
[monad (.only do)]]
[control
@@ -18,7 +17,9 @@
["[0]" random]
[number
["n" nat]
- ["i" int]]]]]
+ ["i" int]]]
+ ["_" test (.only Test)
+ ["[0]" unit]]]]
[\\library
["[0]" / (.only)
[//
@@ -123,6 +124,6 @@
wrote!
destroyed!
(i.= exit await))))]
- (_.coverage' [/.Shell]
+ (unit.coverage [/.Shell]
(try.else false verdict)))))
)))