diff options
Diffstat (limited to 'stdlib/source/spec')
-rw-r--r-- | stdlib/source/spec/lux/world/console.lux | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/stdlib/source/spec/lux/world/console.lux b/stdlib/source/spec/lux/world/console.lux index f875cd07e..5bfcf1ff8 100644 --- a/stdlib/source/spec/lux/world/console.lux +++ b/stdlib/source/spec/lux/world/console.lux @@ -10,6 +10,9 @@ ["!" capability]] [concurrency ["." promise (#+ Promise)]]] + [data + ["." text + ["%" format (#+ format)]]] [math ["." random]]] {1 @@ -22,19 +25,12 @@ [message (random.ascii/alpha 10)] (wrap (do promise.monad [console (promise.future console) + ?write (!.use (\ console write) [(format message text.new_line)]) ?read (!.use (\ console read) []) ?read_line (!.use (\ console read_line) []) - ?write (!.use (\ console write) [message]) ?close/good (!.use (\ console close) []) ?close/bad (!.use (\ console close) [])] ($_ _.and' - (_.cover' [/.Can_Read] - (case [?read ?read_line] - [(#try.Success _) (#try.Success _)] - true - - _ - false)) (_.cover' [/.Can_Write] (case ?write (#try.Success _) @@ -42,6 +38,13 @@ _ false)) + (_.cover' [/.Can_Read] + (case [?read ?read_line] + [(#try.Success _) (#try.Success _)] + true + + _ + false)) (_.cover' [/.Can_Close] (case [?close/good ?close/bad] [(#try.Success _) (#try.Failure _)] |