diff options
Diffstat (limited to 'stdlib/source/test/aedifex/command')
-rw-r--r-- | stdlib/source/test/aedifex/command/auto.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/command/build.lux | 42 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/command/clean.lux | 16 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/command/deploy.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/command/deps.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/command/install.lux | 6 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/command/pom.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/command/test.lux | 12 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/command/version.lux | 14 |
9 files changed, 51 insertions, 51 deletions
diff --git a/stdlib/source/test/aedifex/command/auto.lux b/stdlib/source/test/aedifex/command/auto.lux index 6834fe8eb..2d6ed1354 100644 --- a/stdlib/source/test/aedifex/command/auto.lux +++ b/stdlib/source/test/aedifex/command/auto.lux @@ -44,7 +44,7 @@ [dependency [resolution (.only Resolution)]]]]]) -(def: (command expected_runs end_signal fs dummy_file) +(def (command expected_runs end_signal fs dummy_file) (-> Nat Text (file.System Async) file.Path [(Atom Nat) (-> (Console Async) (Program Async) (file.System Async) (Shell Async) Resolution (Command [Exit Any]))]) @@ -61,7 +61,7 @@ _ (at fs modify dummy_file (|> actual_runs .int instant.of_millis))] (in [shell.normal []])))))])) -(def: .public test +(def .public test Test (<| (_.covering /._) (do [! random.monad] diff --git a/stdlib/source/test/aedifex/command/build.lux b/stdlib/source/test/aedifex/command/build.lux index c740ad48f..47c3ac71a 100644 --- a/stdlib/source/test/aedifex/command/build.lux +++ b/stdlib/source/test/aedifex/command/build.lux @@ -37,50 +37,50 @@ ["[1][0]" dependency (.only Dependency) ["[1]/[0]" resolution (.only Resolution)]]]]]) -(def: .public good_shell +(def .public good_shell (-> Any (Shell IO)) (shell.mock (function (_ [actual_environment actual_working_directory actual_command actual_arguments]) {try.#Success (is (shell.Mock []) (implementation - (def: (on_read state) + (def (on_read state) (exception.except shell.no_more_output [])) - (def: (on_fail state) + (def (on_fail state) (exception.except shell.no_more_output [])) - (def: (on_write input state) + (def (on_write input state) {try.#Failure "on_write"}) - (def: (on_destroy state) + (def (on_destroy state) {try.#Failure "on_destroy"}) - (def: (on_await state) + (def (on_await state) {try.#Success [state shell.normal]})))}))) -(def: .public bad_shell +(def .public bad_shell (-> Any (Shell IO)) (shell.mock (function (_ [actual_environment actual_working_directory actual_command actual_arguments]) {try.#Success (is (shell.Mock []) (implementation - (def: (on_read state) + (def (on_read state) (exception.except shell.no_more_output [])) - (def: (on_fail state) + (def (on_fail state) (exception.except shell.no_more_output [])) - (def: (on_write input state) + (def (on_write input state) {try.#Failure "on_write"}) - (def: (on_destroy state) + (def (on_destroy state) {try.#Failure "on_destroy"}) - (def: (on_await state) + (def (on_await state) {try.#Success [state shell.error]})))}))) -(def: .public (reader_shell error?) +(def .public (reader_shell error?) (-> Bit (-> (List Text) (Shell IO))) (shell.mock (function (_ [actual_environment actual_working_directory actual_command actual_arguments]) {try.#Success (is (shell.Mock (List Text)) (implementation - (def: (on_read state) + (def (on_read state) (if error? (exception.except shell.no_more_output []) (case state @@ -89,7 +89,7 @@ {.#End} (exception.except shell.no_more_output [])))) - (def: (on_fail state) + (def (on_fail state) (if error? (case state {.#Item head tail} @@ -98,14 +98,14 @@ {.#End} (exception.except shell.no_more_output [])) (exception.except shell.no_more_output []))) - (def: (on_write input state) + (def (on_write input state) {try.#Failure "on_write"}) - (def: (on_destroy state) + (def (on_destroy state) {try.#Failure "on_destroy"}) - (def: (on_await state) + (def (on_await state) {try.#Success [state shell.error]})))}))) -(def: compiler +(def compiler (Random Dependency) (do random.monad [lux_version (random.alphabetic 5) @@ -127,7 +127,7 @@ [/.ruby_lux_name] )))))) -(def: .public resolution +(def .public resolution (Random [Dependency Resolution]) (do random.monad [dependency ..compiler @@ -136,7 +136,7 @@ (|> ///dependency/resolution.empty (dictionary.has dependency package))]))) -(def: .public test +(def .public test Test (<| (_.covering /._) (do [! random.monad] diff --git a/stdlib/source/test/aedifex/command/clean.lux b/stdlib/source/test/aedifex/command/clean.lux index 4f37c7bc3..7edf91440 100644 --- a/stdlib/source/test/aedifex/command/clean.lux +++ b/stdlib/source/test/aedifex/command/clean.lux @@ -36,11 +36,11 @@ ["[1]" profile] ["[1][0]" action (.only Action)]]]]) -(def: node_name +(def node_name (Random Text) (random.alphabetic 10)) -(def: (files prefix) +(def (files prefix) (-> Path (Random (List [Path Binary]))) (do [! random.monad] [count (at ! each (n.% 10) random.nat) @@ -49,11 +49,11 @@ (in (list.zipped_2 (list#each (|>> (format prefix)) (set.list names)) contents)))) -(def: (create_file! fs [path content]) +(def (create_file! fs [path content]) (-> (file.System Async) [Path Binary] (Async (Try Any))) (at fs write path content)) -(def: (create_directory! fs path files) +(def (create_directory! fs path files) (-> (file.System Async) Path (List [Path Binary]) (Async (Try Any))) (do [! (try.with async.monad)] [_ (is (Async (Try Any)) @@ -61,15 +61,15 @@ _ (monad.each ! (..create_file! fs) files)] (in []))) -(def: (directory_exists? fs) +(def (directory_exists? fs) (-> (file.System Async) Path (Async (Try Bit))) (|>> (at fs directory?) (try.lifted async.monad))) -(def: (file_exists? fs) +(def (file_exists? fs) (-> (file.System Async) Path (Async (Try Bit))) (|>> (at fs file?) (try.lifted async.monad))) -(def: (assets_exist? fs directory_path files) +(def (assets_exist? fs directory_path files) (-> (file.System Async) Path (List [Path Binary]) (Async (Try Bit))) (do [! (try.with async.monad)] [directory_exists? (..directory_exists? fs directory_path) @@ -80,7 +80,7 @@ (in (and directory_exists? (list.every? (|>>) files_exist?))))) -(def: .public test +(def .public test Test (<| (_.covering /._) (do [! random.monad] diff --git a/stdlib/source/test/aedifex/command/deploy.lux b/stdlib/source/test/aedifex/command/deploy.lux index 871083df6..7b709c82d 100644 --- a/stdlib/source/test/aedifex/command/deploy.lux +++ b/stdlib/source/test/aedifex/command/deploy.lux @@ -53,7 +53,7 @@ ["[1][0]" artifact (.only Artifact) ["[1]/[0]" extension]]]]]) -(def: (execute! program local remote fs artifact profile) +(def (execute! program local remote fs artifact profile) (-> (Program Async) (Repository Async) (Repository Async) (file.System Async) Artifact ///.Profile (Async (Try Text))) @@ -64,7 +64,7 @@ _ (/.do! program shell console local remote fs artifact profile)] (at console read_line []))) -(def: .public test +(def .public test Test (<| (_.covering /._) (do [! random.monad] diff --git a/stdlib/source/test/aedifex/command/deps.lux b/stdlib/source/test/aedifex/command/deps.lux index 450152fe2..14d0f040b 100644 --- a/stdlib/source/test/aedifex/command/deps.lux +++ b/stdlib/source/test/aedifex/command/deps.lux @@ -52,7 +52,7 @@ ["[1]/[0]" origin] ["[1]/[0]" local]]]]]]) -(def: .public test +(def .public test Test (<| (_.covering /._) (do random.monad diff --git a/stdlib/source/test/aedifex/command/install.lux b/stdlib/source/test/aedifex/command/install.lux index de26f5ecb..a55e96d95 100644 --- a/stdlib/source/test/aedifex/command/install.lux +++ b/stdlib/source/test/aedifex/command/install.lux @@ -38,7 +38,7 @@ ["[1][0]" repository ["[1]/[0]" local]]]]]) -(def: .public (make_sources! fs sources) +(def .public (make_sources! fs sources) (-> (file.System Async) (Set file.Path) (Action (List Any))) (let [/ (at fs separator) ! ///action.monad] @@ -51,7 +51,7 @@ (is (Async (Try Any)) (file.make_file async.monad fs (binary.empty 0) (format head / head ".lux"))))))))) -(def: (execute! program fs sample) +(def (execute! program fs sample) (-> (Program Async) (file.System Async) ///.Profile (Async (Try Text))) (do ///action.monad [.let [console ($version.echo "")] @@ -59,7 +59,7 @@ _ (/.do! console fs (///repository/local.repository program fs) sample)] (at console read_line []))) -(def: .public test +(def .public test Test (<| (_.covering /._) (do [! random.monad] diff --git a/stdlib/source/test/aedifex/command/pom.lux b/stdlib/source/test/aedifex/command/pom.lux index 278d91209..f6ba0e28e 100644 --- a/stdlib/source/test/aedifex/command/pom.lux +++ b/stdlib/source/test/aedifex/command/pom.lux @@ -30,7 +30,7 @@ ["[1][0]" action] ["[1][0]" pom]]]]) -(def: .public test +(def .public test Test (<| (_.covering /._) (do random.monad diff --git a/stdlib/source/test/aedifex/command/test.lux b/stdlib/source/test/aedifex/command/test.lux index 9b01c2feb..7ab540925 100644 --- a/stdlib/source/test/aedifex/command/test.lux +++ b/stdlib/source/test/aedifex/command/test.lux @@ -39,7 +39,7 @@ ["[1][0]" dependency (.only) ["[1]/[0]" resolution]]]]]]) -(def: .public test +(def .public test Test (<| (_.covering /._) (do [! random.monad] @@ -86,15 +86,15 @@ {try.#Success (is (shell.Mock []) (implementation - (def: (on_read state) + (def (on_read state) (exception.except shell.no_more_output [])) - (def: (on_fail state) + (def (on_fail state) (exception.except shell.no_more_output [])) - (def: (on_write input state) + (def (on_write input state) {try.#Failure "on_write"}) - (def: (on_destroy state) + (def (on_destroy state) {try.#Failure "on_destroy"}) - (def: (on_await state) + (def (on_await state) {try.#Success [state (if (list.any? (text#= "build") actual_arguments) shell.normal shell.error)]})))}) diff --git a/stdlib/source/test/aedifex/command/version.lux b/stdlib/source/test/aedifex/command/version.lux index 740065820..c8f427a71 100644 --- a/stdlib/source/test/aedifex/command/version.lux +++ b/stdlib/source/test/aedifex/command/version.lux @@ -29,10 +29,10 @@ (exception: .public console_is_closed!) -(def: mock +(def mock (Mock [Bit Text]) (implementation - (def: (on_read [open? state]) + (def (on_read [open? state]) (if open? (try.of_maybe (do maybe.monad @@ -40,29 +40,29 @@ [_ tail] (text.split_at 1 state)] (in [[open? tail] head]))) (exception.except ..console_is_closed! []))) - (def: (on_read_line [open? state]) + (def (on_read_line [open? state]) (if open? (try.of_maybe (do maybe.monad [[output state] (text.split_by text.new_line state)] (in [[open? state] output]))) (exception.except ..console_is_closed! []))) - (def: (on_write input [open? state]) + (def (on_write input [open? state]) (if open? {try.#Success [open? (format state input)]} (exception.except ..console_is_closed! []))) - (def: (on_close [open? buffer]) + (def (on_close [open? buffer]) (if open? {try.#Success [false buffer]} (exception.except ..console_is_closed! []))))) -(def: .public echo +(def .public echo (-> Text (Console Async)) (|>> [true] (console.mock ..mock) console.async)) -(def: .public test +(def .public test Test (<| (_.covering /._) (do random.monad |