diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/aedifex/command/version.lux | 50 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/repository.lux | 34 |
2 files changed, 42 insertions, 42 deletions
diff --git a/stdlib/source/test/aedifex/command/version.lux b/stdlib/source/test/aedifex/command/version.lux index bb92fadfb..96b8cdf3b 100644 --- a/stdlib/source/test/aedifex/command/version.lux +++ b/stdlib/source/test/aedifex/command/version.lux @@ -29,32 +29,32 @@ (exception: .public console_is_closed!) -(implementation: mock +(def: mock (Mock [Bit Text]) - - (def: (on_read [open? state]) - (if open? - (try.of_maybe - (do maybe.monad - [head (text.char 0 state) - [_ tail] (text.split_at 1 state)] - (in [[open? tail] head]))) - (exception.except ..console_is_closed! []))) - (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]) - (if open? - {try.#Success [open? (format state input)]} - (exception.except ..console_is_closed! []))) - (def: (on_close [open? buffer]) - (if open? - {try.#Success [false buffer]} - (exception.except ..console_is_closed! [])))) + (implementation + (def: (on_read [open? state]) + (if open? + (try.of_maybe + (do maybe.monad + [head (text.char 0 state) + [_ tail] (text.split_at 1 state)] + (in [[open? tail] head]))) + (exception.except ..console_is_closed! []))) + (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]) + (if open? + {try.#Success [open? (format state input)]} + (exception.except ..console_is_closed! []))) + (def: (on_close [open? buffer]) + (if open? + {try.#Success [false buffer]} + (exception.except ..console_is_closed! []))))) (def: .public echo (-> Text (Console Async)) diff --git a/stdlib/source/test/aedifex/repository.lux b/stdlib/source/test/aedifex/repository.lux index 7766a492a..56a5c7b54 100644 --- a/stdlib/source/test/aedifex/repository.lux +++ b/stdlib/source/test/aedifex/repository.lux @@ -65,24 +65,24 @@ Version "4.5.6-NO") -(implementation: .public mock +(def: .public mock (/.Mock Store) - - (def: the_description - "@") - (def: (on_download uri state) - (case (dictionary.value uri state) - {.#Some content} - (case (binary.size content) - 0 (exception.except ..not_found [uri]) - _ {try.#Success [state content]}) - - {.#None} - (exception.except ..not_found [uri]))) - (def: (on_upload uri content state) - (if (dictionary.key? state uri) - (exception.except ..cannot_upload [uri]) - {try.#Success (dictionary.has uri content state)}))) + (implementation + (def: the_description + "@") + (def: (on_download uri state) + (case (dictionary.value uri state) + {.#Some content} + (case (binary.size content) + 0 (exception.except ..not_found [uri]) + _ {try.#Success [state content]}) + + {.#None} + (exception.except ..not_found [uri]))) + (def: (on_upload uri content state) + (if (dictionary.key? state uri) + (exception.except ..cannot_upload [uri]) + {try.#Success (dictionary.has uri content state)})))) (def: .public test Test |