aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/world
diff options
context:
space:
mode:
authorEduardo Julian2022-04-09 03:03:46 -0400
committerEduardo Julian2022-04-09 03:03:46 -0400
commit04c7f49a732380a2b9f72b1b937171b341c24323 (patch)
treed54c92bf10665bba0ec4643746becce569604fb2 /stdlib/source/test/lux/world
parentf11afb9d2dfe2d59b41e8056eb8c4ae65268415f (diff)
Better names for testing macros (plus better indentation).
Diffstat (limited to 'stdlib/source/test/lux/world')
-rw-r--r--stdlib/source/test/lux/world/console.lux20
-rw-r--r--stdlib/source/test/lux/world/file.lux38
-rw-r--r--stdlib/source/test/lux/world/file/watch.lux84
-rw-r--r--stdlib/source/test/lux/world/input/keyboard.lux10
-rw-r--r--stdlib/source/test/lux/world/net/http/client.lux28
-rw-r--r--stdlib/source/test/lux/world/net/http/status.lux4
-rw-r--r--stdlib/source/test/lux/world/output/video/resolution.lux6
-rw-r--r--stdlib/source/test/lux/world/program.lux48
-rw-r--r--stdlib/source/test/lux/world/shell.lux8
9 files changed, 123 insertions, 123 deletions
diff --git a/stdlib/source/test/lux/world/console.lux b/stdlib/source/test/lux/world/console.lux
index ebae69a0d..29e8f66e5 100644
--- a/stdlib/source/test/lux/world/console.lux
+++ b/stdlib/source/test/lux/world/console.lux
@@ -57,14 +57,14 @@
(do random.monad
[expected (random.alphabetic 10)
.let [console (/.mock ..mock [false ""])]]
- (_.cover [/.write_line]
- (io.run!
- (do io.monad
- [?_ (/.write_line expected console)
- ?actual (# console read_line [])]
- (in (<| (try.else false)
- (do try.monad
- [_ ?_
- actual ?actual]
- (in (text#= expected actual)))))))))
+ (_.coverage [/.write_line]
+ (io.run!
+ (do io.monad
+ [?_ (/.write_line expected console)
+ ?actual (# console read_line [])]
+ (in (<| (try.else false)
+ (do try.monad
+ [_ ?_
+ actual ?actual]
+ (in (text#= expected actual)))))))))
)))
diff --git a/stdlib/source/test/lux/world/file.lux b/stdlib/source/test/lux/world/file.lux
index c4c8689cd..0ff782b56 100644
--- a/stdlib/source/test/lux/world/file.lux
+++ b/stdlib/source/test/lux/world/file.lux
@@ -253,35 +253,35 @@
(in (do async.monad
[.let [fs (/.mock /)]
? (# fs delete file)]
- (_.cover' [/.cannot_delete]
- (case ?
- {try.#Failure error}
- (exception.match? /.cannot_delete error)
+ (_.coverage' [/.cannot_delete]
+ (case ?
+ {try.#Failure error}
+ (exception.match? /.cannot_delete error)
- _
- false))))
+ _
+ false))))
(in (do async.monad
[.let [fs (/.mock /)]
? (# fs read file)]
- (_.cover' [/.cannot_find_file]
- (case ?
- {try.#Failure error}
- (exception.match? /.cannot_find_file error)
+ (_.coverage' [/.cannot_find_file]
+ (case ?
+ {try.#Failure error}
+ (exception.match? /.cannot_find_file error)
- _
- false))))
+ _
+ false))))
(in (do async.monad
[.let [fs (/.mock /)]
?/0 (# fs directory_files file)
?/1 (# fs sub_directories file)]
- (_.cover' [/.cannot_find_directory]
- (case [?/0 ?/1]
- [{try.#Failure error/0} {try.#Failure error/1}]
- (and (exception.match? /.cannot_find_directory error/0)
- (exception.match? /.cannot_find_directory error/1))
+ (_.coverage' [/.cannot_find_directory]
+ (case [?/0 ?/1]
+ [{try.#Failure error/0} {try.#Failure error/1}]
+ (and (exception.match? /.cannot_find_directory error/0)
+ (exception.match? /.cannot_find_directory error/1))
- _
- false))))
+ _
+ false))))
/watch.test
))))
diff --git a/stdlib/source/test/lux/world/file/watch.lux b/stdlib/source/test/lux/world/file/watch.lux
index 1243694a5..73e09ee96 100644
--- a/stdlib/source/test/lux/world/file/watch.lux
+++ b/stdlib/source/test/lux/world/file/watch.lux
@@ -36,32 +36,32 @@
(def: concern##test
Test
(all _.and
- (_.cover [/.creation /.creation?]
- (and (/.creation? /.creation)
- (not (/.creation? /.modification))
- (not (/.creation? /.deletion))))
- (_.cover [/.modification /.modification?]
- (and (not (/.modification? /.creation))
- (/.modification? /.modification)
- (not (/.modification? /.deletion))))
- (_.cover [/.deletion /.deletion?]
- (and (not (/.deletion? /.creation))
- (not (/.deletion? /.modification))
- (/.deletion? /.deletion)))
+ (_.coverage [/.creation /.creation?]
+ (and (/.creation? /.creation)
+ (not (/.creation? /.modification))
+ (not (/.creation? /.deletion))))
+ (_.coverage [/.modification /.modification?]
+ (and (not (/.modification? /.creation))
+ (/.modification? /.modification)
+ (not (/.modification? /.deletion))))
+ (_.coverage [/.deletion /.deletion?]
+ (and (not (/.deletion? /.creation))
+ (not (/.deletion? /.modification))
+ (/.deletion? /.deletion)))
(do random.monad
[left ..concern
right (random.only (|>> (same? left) not)
..concern)
.let [[left left?] left
[right right?] right]]
- (_.cover [/.also]
- (let [composition (/.also left right)]
- (and (left? composition)
- (right? composition)))))
- (_.cover [/.all]
- (and (/.creation? /.all)
- (/.modification? /.all)
- (/.deletion? /.all)))
+ (_.coverage [/.also]
+ (let [composition (/.also left right)]
+ (and (left? composition)
+ (right? composition)))))
+ (_.coverage [/.all]
+ (and (/.creation? /.all)
+ (/.modification? /.all)
+ (/.deletion? /.all)))
))
(def: exception
@@ -73,19 +73,19 @@
(in (do async.monad
[?concern (# watcher concern directory)
?stop (# watcher stop directory)]
- (_.cover' [/.not_being_watched]
- (and (case ?concern
- {try.#Failure error}
- (exception.match? /.not_being_watched error)
-
- {try.#Success _}
- false)
- (case ?stop
- {try.#Failure error}
- (exception.match? /.not_being_watched error)
-
- {try.#Success _}
- false)))))
+ (_.coverage' [/.not_being_watched]
+ (and (case ?concern
+ {try.#Failure error}
+ (exception.match? /.not_being_watched error)
+
+ {try.#Success _}
+ false)
+ (case ?stop
+ {try.#Failure error}
+ (exception.match? /.not_being_watched error)
+
+ {try.#Success _}
+ false)))))
)))
(def: (no_events_prior_to_creation! fs watcher directory)
@@ -181,19 +181,19 @@
after_creation!
after_modification!
after_deletion!)))]
- (_.cover' [/.mock /.polling]
- (try.else false verdict)))))
+ (_.coverage' [/.mock /.polling]
+ (try.else false verdict)))))
(do random.monad
[directory (random.alphabetic 5)
.let [/ "/"
[fs watcher] (/.mock /)]]
(in (do async.monad
[started? (# watcher start /.all directory)]
- (_.cover' [/.cannot_poll_a_non_existent_directory]
- (case started?
- {try.#Success _}
- false
-
- {try.#Failure error}
- (exception.match? /.cannot_poll_a_non_existent_directory error))))))
+ (_.coverage' [/.cannot_poll_a_non_existent_directory]
+ (case started?
+ {try.#Success _}
+ false
+
+ {try.#Failure error}
+ (exception.match? /.cannot_poll_a_non_existent_directory error))))))
)))
diff --git a/stdlib/source/test/lux/world/input/keyboard.lux b/stdlib/source/test/lux/world/input/keyboard.lux
index 0e509448c..5e2e33364 100644
--- a/stdlib/source/test/lux/world/input/keyboard.lux
+++ b/stdlib/source/test/lux/world/input/keyboard.lux
@@ -131,8 +131,8 @@
(template [<definition> <keys>]
[(def: <definition>
Test
- (_.cover <keys>
- ..verdict))]
+ (_.coverage <keys>
+ ..verdict))]
<groups>)
@@ -159,9 +159,9 @@
[(do random.monad
[key ..random
.let [sample (<function> key)]]
- (_.cover [<function>]
- (and (bit#= <pressed?> (the /.#pressed? sample))
- (n.= key (the /.#input sample)))))]
+ (_.coverage [<function>]
+ (and (bit#= <pressed?> (the /.#pressed? sample))
+ (n.= key (the /.#input sample)))))]
[#0 /.release]
[#1 /.press]
diff --git a/stdlib/source/test/lux/world/net/http/client.lux b/stdlib/source/test/lux/world/net/http/client.lux
index 7ed8fa32d..560162875 100644
--- a/stdlib/source/test/lux/world/net/http/client.lux
+++ b/stdlib/source/test/lux/world/net/http/client.lux
@@ -99,19 +99,19 @@
[/.trace on_trace])]
(`` (all _.and
(~~ (template [<definition> <expected>]
- [(_.cover [<definition>]
- (|> (<definition> "" //.empty {.#None} mock)
- (verification io.monad <expected>)
- io.run!))]
+ [(_.coverage [<definition>]
+ (|> (<definition> "" //.empty {.#None} mock)
+ (verification io.monad <expected>)
+ io.run!))]
<cases>
))
- (_.cover [/.headers]
- (nat.= (dictionary.size headers)
- (|> headers
- dictionary.entries
- /.headers
- dictionary.size)))
+ (_.coverage [/.headers]
+ (nat.= (dictionary.size headers)
+ (|> headers
+ dictionary.entries
+ /.headers
+ dictionary.size)))
(in (do [! async.monad]
[.let [mock (/.async mock)]
(~~ (template [<definition> <expected>]
@@ -119,9 +119,9 @@
(verification ! <expected>))]
<cases>))]
- (_.cover' [/.async]
- (and (~~ (template [<definition> <expected>]
- [<expected>]
+ (_.coverage' [/.async]
+ (and (~~ (template [<definition> <expected>]
+ [<expected>]
- <cases>))))))
+ <cases>))))))
))))))
diff --git a/stdlib/source/test/lux/world/net/http/status.lux b/stdlib/source/test/lux/world/net/http/status.lux
index 3dc8326ae..90ad92906 100644
--- a/stdlib/source/test/lux/world/net/http/status.lux
+++ b/stdlib/source/test/lux/world/net/http/status.lux
@@ -103,8 +103,8 @@
(template [<category> <status+>]
[(def: <category>
Test
- (_.cover <status+>
- ..verdict))]
+ (_.coverage <status+>
+ ..verdict))]
<categories>)
diff --git a/stdlib/source/test/lux/world/output/video/resolution.lux b/stdlib/source/test/lux/world/output/video/resolution.lux
index 65713e748..3d46dc916 100644
--- a/stdlib/source/test/lux/world/output/video/resolution.lux
+++ b/stdlib/source/test/lux/world/output/video/resolution.lux
@@ -60,7 +60,7 @@
(_.for [/.hash]
($hash.spec /.hash ..random))
- (_.cover [<resolutions>]
- (n.= (list.size ..listing)
- (set.size ..catalogue)))
+ (_.coverage [<resolutions>]
+ (n.= (list.size ..listing)
+ (set.size ..catalogue)))
))))
diff --git a/stdlib/source/test/lux/world/program.lux b/stdlib/source/test/lux/world/program.lux
index d9c04e2ba..6c82d00da 100644
--- a/stdlib/source/test/lux/world/program.lux
+++ b/stdlib/source/test/lux/world/program.lux
@@ -51,28 +51,28 @@
(all _.and
(_.for [/.mock /.async]
($/.spec (/.async (/.mock environment home directory))))
- (_.cover [/.environment]
- (let [program (/.mock environment home directory)]
- (io.run!
- (do io.monad
- [actual (/.environment io.monad program)]
- (in (and (n.= (dictionary.size environment)
- (dictionary.size actual))
- (|> actual
- dictionary.entries
- (list.every? (function (_ [key value])
- (|> environment
- (dictionary.value key)
- (maybe#each (text#= value))
- (maybe.else false)))))))))))
- (_.cover [/.unknown_environment_variable]
- (let [program (/.mock environment home directory)]
- (|> unknown
- (# program variable)
- io.run!
- (pipe.case {try.#Success _}
- false
-
- {try.#Failure error}
- (exception.match? /.unknown_environment_variable error)))))
+ (_.coverage [/.environment]
+ (let [program (/.mock environment home directory)]
+ (io.run!
+ (do io.monad
+ [actual (/.environment io.monad program)]
+ (in (and (n.= (dictionary.size environment)
+ (dictionary.size actual))
+ (|> actual
+ dictionary.entries
+ (list.every? (function (_ [key value])
+ (|> environment
+ (dictionary.value key)
+ (maybe#each (text#= value))
+ (maybe.else false)))))))))))
+ (_.coverage [/.unknown_environment_variable]
+ (let [program (/.mock environment home directory)]
+ (|> unknown
+ (# program variable)
+ io.run!
+ (pipe.case {try.#Success _}
+ false
+
+ {try.#Failure error}
+ (exception.match? /.unknown_environment_variable error)))))
))))
diff --git a/stdlib/source/test/lux/world/shell.lux b/stdlib/source/test/lux/world/shell.lux
index 6de1d8a38..1c51086d6 100644
--- a/stdlib/source/test/lux/world/shell.lux
+++ b/stdlib/source/test/lux/world/shell.lux
@@ -87,8 +87,8 @@
(_.for [/.async /.mock /.Mock]
($/.spec (/.async (/.mock (|>> ..mock {try.#Success})
false))))
- (_.cover [/.error]
- (not (i.= /.normal /.error)))
+ (_.coverage [/.error]
+ (not (i.= /.normal /.error)))
(do random.monad
[command (random.alphabetic 5)
oops (random.alphabetic 5)
@@ -123,6 +123,6 @@
wrote!
destroyed!
(i.= exit await))))]
- (_.cover' [/.Shell]
- (try.else false verdict)))))
+ (_.coverage' [/.Shell]
+ (try.else false verdict)))))
)))