aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/spec
diff options
context:
space:
mode:
authorEduardo Julian2021-01-13 17:42:20 -0400
committerEduardo Julian2021-01-13 17:42:20 -0400
commitae56acf791c2ed9bd5865f85fffa00b025d310fe (patch)
treed02c6f67240b27c578b7e8ca17285824eae56497 /stdlib/source/spec
parent71de092a045dc70ab1c9eead477cf1512b144a87 (diff)
Removed the (ultimately redundant) on_stop function for actors.
Diffstat (limited to 'stdlib/source/spec')
-rw-r--r--stdlib/source/spec/lux/world/console.lux19
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 _)]