diff options
author | Eduardo Julian | 2022-06-16 00:48:19 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-06-16 00:48:19 -0400 |
commit | 9e2f1e76f2c8df01ed7687d934c3210fcf676bd6 (patch) | |
tree | 115fab5bd8a5f53dc0d13ce5453095324a83496f /stdlib/source/test/lux/world | |
parent | f92c806ee8da63f04bbefbf558f6249bacdb47ea (diff) |
De-sigil-ification: suffix : [Part 13]
Diffstat (limited to 'stdlib/source/test/lux/world')
-rw-r--r-- | stdlib/source/test/lux/world/console.lux | 12 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/file.lux | 46 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/file/watch.lux | 16 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/input/keyboard.lux | 12 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/net/http/client.lux | 6 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/net/http/status.lux | 10 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/output/video/resolution.lux | 8 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/program.lux | 6 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/shell.lux | 28 |
9 files changed, 72 insertions, 72 deletions
diff --git a/stdlib/source/test/lux/world/console.lux b/stdlib/source/test/lux/world/console.lux index cd3ac7f1d..cc43e3860 100644 --- a/stdlib/source/test/lux/world/console.lux +++ b/stdlib/source/test/lux/world/console.lux @@ -20,10 +20,10 @@ (exception: dead) -(def: mock +(def mock (/.Mock [Bit Text]) (implementation - (def: (on_read [dead? content]) + (def (on_read [dead? content]) (do try.monad [char (try.of_maybe (text.char 0 content)) [_ content] (try.of_maybe (text.split_at 1 content))] @@ -31,24 +31,24 @@ (exception.except ..dead []) (in [[dead? content] char])))) - (def: (on_read_line [dead? content]) + (def (on_read_line [dead? content]) (do try.monad [[line content] (try.of_maybe (text.split_by text.new_line content))] (if dead? (exception.except ..dead []) (in [[dead? content] line])))) - (def: (on_write message [dead? content]) + (def (on_write message [dead? content]) (if dead? (exception.except ..dead []) {try.#Success [dead? (format content message)]})) - (def: (on_close [dead? content]) + (def (on_close [dead? content]) (if dead? (exception.except ..dead []) {try.#Success [true content]})))) -(def: .public test +(def .public test Test (<| (_.covering /._) (all _.and diff --git a/stdlib/source/test/lux/world/file.lux b/stdlib/source/test/lux/world/file.lux index 872436a4f..3f8cb84f4 100644 --- a/stdlib/source/test/lux/world/file.lux +++ b/stdlib/source/test/lux/world/file.lux @@ -33,7 +33,7 @@ (type: Disk (Dictionary /.Path (Either [Instant Binary] (List Text)))) -(def: (file? disk @) +(def (file? disk @) (-> (Atom Disk) (-> /.Path (IO Bit))) (do io.monad [disk (atom.read! disk)] @@ -42,7 +42,7 @@ {.#Some {.#Left _}} true {.#Some {.#Right _}} false)))) -(def: (directory? disk @) +(def (directory? disk @) (-> (Atom Disk) (-> /.Path (IO Bit))) (do io.monad [disk (atom.read! disk)] @@ -51,7 +51,7 @@ {.#Some {.#Left _}} false {.#Some {.#Right _}} true)))) -(def: (alert_parent! disk alert @) +(def (alert_parent! disk alert @) (-> (Atom Disk) (-> (List /.Path) (List /.Path)) (-> /.Path (IO (Try Any)))) @@ -66,7 +66,7 @@ _ (in {try.#Failure ""})))) -(def: (write fs disk @ it) +(def (write fs disk @ it) (-> (/.System Async) (Atom Disk) (-> /.Path Binary (IO (Try Any)))) (do [! io.monad] [now instant.now @@ -86,7 +86,7 @@ _ (in {try.#Failure ""})))) -(def: (read disk @) +(def (read disk @) (-> (Atom Disk) (-> /.Path (IO (Try Binary)))) (do io.monad [disk (atom.read! disk)] @@ -97,7 +97,7 @@ _ {try.#Failure ""})))) -(def: (delete fs disk @) +(def (delete fs disk @) (-> (/.System Async) (Atom Disk) (-> /.Path (IO (Try Any)))) (do [! io.monad] @@ -123,21 +123,21 @@ _ (in {try.#Failure ""})))) -(def: (fs /) +(def (fs /) (-> Text (/.System IO)) (let [disk (is (Atom Disk) (atom.atom (dictionary.empty text.hash))) mock (/.mock /)] (implementation - (def: separator /) + (def separator /) - (def: file? (..file? disk)) - (def: directory? (..directory? disk)) - (def: write (..write mock disk)) - (def: read (..read disk)) - (def: delete (..delete mock disk)) + (def file? (..file? disk)) + (def directory? (..directory? disk)) + (def write (..write mock disk)) + (def read (..read disk)) + (def delete (..delete mock disk)) - (def: (file_size @) + (def (file_size @) (do [! io.monad] [disk (atom.read! disk)] (in (case (dictionary.value @ disk) @@ -146,7 +146,7 @@ _ {try.#Failure ""})))) - (def: (last_modified @) + (def (last_modified @) (do [! io.monad] [disk (atom.read! disk)] (in (case (dictionary.value @ disk) @@ -155,7 +155,7 @@ _ {try.#Failure ""})))) - (def: (can_execute? @) + (def (can_execute? @) (do [! io.monad] [disk (atom.read! disk)] (in (case (dictionary.value @ disk) @@ -165,7 +165,7 @@ _ {try.#Failure ""})))) - (def: (make_directory @) + (def (make_directory @) (do [! io.monad] [disk' (atom.read! disk)] (case (dictionary.value @ disk') @@ -181,7 +181,7 @@ _ (in {try.#Failure ""})))) - (def: (directory_files @) + (def (directory_files @) (do [! io.monad] [disk' (atom.read! disk)] (case (dictionary.value @ disk') @@ -192,7 +192,7 @@ _ (in {try.#Failure ""})))) - (def: (sub_directories @) + (def (sub_directories @) (do [! io.monad] [disk' (atom.read! disk)] (case (dictionary.value @ disk') @@ -203,7 +203,7 @@ _ (in {try.#Failure ""})))) - (def: (append @ it) + (def (append @ it) (do [! io.monad] [now instant.now disk' (atom.read! disk)] @@ -220,7 +220,7 @@ _ (in {try.#Failure ""})))) - (def: (modify @ it) + (def (modify @ it) (do [! io.monad] [disk' (atom.read! disk)] (case (dictionary.value @ disk') @@ -231,14 +231,14 @@ _ (in {try.#Failure ""})))) - (def: (move @ it) + (def (move @ it) (do [! (try.with io.monad)] [data (..read disk @) write (..write mock disk it data)] (..delete mock disk @))) ))) -(def: .public test +(def .public test Test (<| (_.covering /._) (do [! random.monad] diff --git a/stdlib/source/test/lux/world/file/watch.lux b/stdlib/source/test/lux/world/file/watch.lux index 2a2053e77..78e239524 100644 --- a/stdlib/source/test/lux/world/file/watch.lux +++ b/stdlib/source/test/lux/world/file/watch.lux @@ -25,7 +25,7 @@ [data ["$[0]" binary]]]) -(def: concern +(def concern (Random [/.Concern (Predicate /.Concern)]) (all random.either (random#in [/.creation /.creation?]) @@ -33,7 +33,7 @@ (random#in [/.deletion /.deletion?]) )) -(def: concern::test +(def concern::test Test (all _.and (_.coverage [/.creation /.creation?] @@ -64,7 +64,7 @@ (/.deletion? /.all))) )) -(def: exception +(def exception Test (do [! random.monad] [directory (random.alphabetic 5) @@ -88,7 +88,7 @@ false))))) ))) -(def: (no_events_prior_to_creation! fs watcher directory) +(def (no_events_prior_to_creation! fs watcher directory) (-> (//.System Async) (/.Watcher Async) //.Path (Async (Try Bit))) (do [! (try.with async.monad)] [_ (at fs make_directory directory) @@ -96,7 +96,7 @@ (|> (at watcher poll []) (at ! each list.empty?)))) -(def: (after_creation! fs watcher expected_path) +(def (after_creation! fs watcher expected_path) (-> (//.System Async) (/.Watcher Async) //.Path (Async (Try Bit))) (do (try.with async.monad) [_ (is (Async (Try Any)) @@ -114,7 +114,7 @@ false) (list.empty? poll/post))))) -(def: (after_modification! fs watcher data expected_path) +(def (after_modification! fs watcher data expected_path) (-> (//.System Async) (/.Watcher Async) Binary //.Path (Async (Try Bit))) (do (try.with async.monad) [_ (async.after 1 {try.#Success "Delay to make sure the over_write time-stamp always changes."}) @@ -132,7 +132,7 @@ false) (list.empty? poll/2'))))) -(def: (after_deletion! fs watcher expected_path) +(def (after_deletion! fs watcher expected_path) (-> (//.System Async) (/.Watcher Async) //.Path (Async (Try Bit))) (do (try.with async.monad) [_ (at fs delete expected_path) @@ -148,7 +148,7 @@ false) (list.empty? poll/3'))))) -(def: .public test +(def .public test Test (<| (_.covering /._) (_.for [/.Watcher]) diff --git a/stdlib/source/test/lux/world/input/keyboard.lux b/stdlib/source/test/lux/world/input/keyboard.lux index 6d3daa301..a2db959e7 100644 --- a/stdlib/source/test/lux/world/input/keyboard.lux +++ b/stdlib/source/test/lux/world/input/keyboard.lux @@ -110,7 +110,7 @@ /.f22 /.f23 /.f24]])] - (def: listing + (def listing (List /.Key) (list.together (`` (list (~~ (with_template [<definition> <keys>] [((is (-> Any (List /.Key)) @@ -120,30 +120,30 @@ <groups>)))))) - (def: catalogue + (def catalogue (Set /.Key) (set.of_list n.hash ..listing)) - (def: verdict + (def verdict (n.= (list.size ..listing) (set.size ..catalogue))) (with_template [<definition> <keys>] - [(def: <definition> + [(def <definition> Test (_.coverage <keys> ..verdict))] <groups>) - (def: .public random + (def .public random (Random /.Key) (let [count (list.size ..listing)] (do [! random.monad] [choice (at ! each (n.% count) random.nat)] (in (maybe.trusted (list.item choice ..listing)))))) - (def: .public test + (def .public test Test (<| (_.covering /._) (_.for [/.Key]) diff --git a/stdlib/source/test/lux/world/net/http/client.lux b/stdlib/source/test/lux/world/net/http/client.lux index 1ccf30196..1572f30d3 100644 --- a/stdlib/source/test/lux/world/net/http/client.lux +++ b/stdlib/source/test/lux/world/net/http/client.lux @@ -29,7 +29,7 @@ ["/[1]" // (.only) ["[1][0]" status]]]]) -(def: (verification ! expected response) +(def (verification ! expected response) (All (_ !) (-> (Monad !) Nat (! (Try (//.Response !))) (! Bit))) @@ -51,7 +51,7 @@ {try.#Failure error} (in false)))) -(def: .public test +(def .public test Test (<| (_.covering /._) (_.for [/.Client]) @@ -69,7 +69,7 @@ headers (random.dictionary text.hash num_headers (random.lower_case 3) (random.lower_case 3)) .let [mock (is (/.Client IO) (implementation - (def: (request method url headers data) + (def (request method url headers data) (io.io (let [value (case method {//.#Post} on_post {//.#Get} on_get diff --git a/stdlib/source/test/lux/world/net/http/status.lux b/stdlib/source/test/lux/world/net/http/status.lux index 28789a09a..4ba760537 100644 --- a/stdlib/source/test/lux/world/net/http/status.lux +++ b/stdlib/source/test/lux/world/net/http/status.lux @@ -82,7 +82,7 @@ /.loop_detected /.not_extended /.network_authentication_required]])] - (def: all + (def all (List //.Status) (list.together (`` (list (~~ (with_template [<category> <status+>] [((is (-> Any (List //.Status)) @@ -92,23 +92,23 @@ <categories>)))))) - (def: unique + (def unique (Set //.Status) (set.of_list n.hash ..all)) - (def: verdict + (def verdict (n.= (list.size ..all) (set.size ..unique))) (with_template [<category> <status+>] - [(def: <category> + [(def <category> Test (_.coverage <status+> ..verdict))] <categories>) - (def: .public test + (def .public test Test (<| (_.covering /._) (`` (.all _.and diff --git a/stdlib/source/test/lux/world/output/video/resolution.lux b/stdlib/source/test/lux/world/output/video/resolution.lux index f9e679733..d7fa6e20b 100644 --- a/stdlib/source/test/lux/world/output/video/resolution.lux +++ b/stdlib/source/test/lux/world/output/video/resolution.lux @@ -35,22 +35,22 @@ /.wuxga /.wqhd /.uhd_4k)] - (def: listing + (def listing (List /.Resolution) (list <resolutions>)) - (def: catalogue + (def catalogue (Set /.Resolution) (set.of_list /.hash ..listing)) - (def: .public random + (def .public random (Random /.Resolution) (let [count (list.size ..listing)] (do [! random.monad] [choice (at ! each (n.% count) random.nat)] (in (maybe.trusted (list.item choice ..listing)))))) - (def: .public test + (def .public test Test (<| (_.covering /._) (_.for [/.Resolution]) diff --git a/stdlib/source/test/lux/world/program.lux b/stdlib/source/test/lux/world/program.lux index 3067422e0..dac2768c9 100644 --- a/stdlib/source/test/lux/world/program.lux +++ b/stdlib/source/test/lux/world/program.lux @@ -28,17 +28,17 @@ [\\specification ["$[0]" /]]) -(def: (environment env_size) +(def (environment env_size) (-> Nat (Random Environment)) (random.dictionary text.hash env_size (random.alphabetic 5) (random.alphabetic 5))) -(def: path +(def path (Random Path) (random.alphabetic 5)) -(def: .public test +(def .public test Test (<| (_.covering /._) (do [! random.monad] diff --git a/stdlib/source/test/lux/world/shell.lux b/stdlib/source/test/lux/world/shell.lux index 3ad40e908..dd83fd31b 100644 --- a/stdlib/source/test/lux/world/shell.lux +++ b/stdlib/source/test/lux/world/shell.lux @@ -30,57 +30,57 @@ (exception: dead) -(def: (mock [environment working_directory command arguments]) +(def (mock [environment working_directory command arguments]) (-> [Environment Path /.Command (List /.Argument)] (/.Mock Bit)) (implementation - (def: (on_read dead?) + (def (on_read dead?) (if dead? (exception.except ..dead []) (do try.monad [echo (try.of_maybe (list.head arguments))] (in [dead? echo])))) - (def: (on_fail dead?) + (def (on_fail dead?) (if dead? (exception.except ..dead []) {try.#Success [dead? ""]})) - (def: (on_write message dead?) + (def (on_write message dead?) (if dead? (exception.except ..dead []) {try.#Success dead?})) - (def: (on_destroy dead?) + (def (on_destroy dead?) (if dead? (exception.except ..dead []) {try.#Success true})) - (def: (on_await dead?) + (def (on_await dead?) (if dead? (exception.except ..dead []) {try.#Success [true /.normal]})))) -(def: (io_shell command oops input destruction exit) +(def (io_shell command oops input destruction exit) (-> /.Command Text Text Text /.Exit (/.Shell IO)) (implementation - (def: (execute [environment working_directory command arguments]) + (def (execute [environment working_directory command arguments]) (<| io.io {try.#Success} (is (/.Process IO)) (implementation - (def: (read _) + (def (read _) (io.io {try.#Success command})) - (def: (fail _) + (def (fail _) (io.io {try.#Success oops})) - (def: (write message) + (def (write message) (io.io {try.#Failure message})) - (def: (destroy _) + (def (destroy _) (io.io {try.#Failure destruction})) - (def: (await _) + (def (await _) (io.io {try.#Success exit}))))))) -(def: .public test +(def .public test Test (<| (_.covering /._) (all _.and |