1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-15 15:57:41 +00:00
Also add ev/give-supervisor to the core.
This commit is contained in:
Calvin Rose
2021-01-16 07:18:07 -06:00
parent 16fe32215b
commit a1cc5ca045
4 changed files with 58 additions and 19 deletions

View File

@@ -74,6 +74,25 @@
(calc-2 "(+ 9 10 11 12)"))
@[10 26 42]) "parallel subprocesses 2")
# File piping
(assert-no-error "file writing 1"
(with [f (file/temp)]
(os/execute [janet "-e" `(repeat 20 (print :hello))`] :p {:out f})))
(assert-no-error "file writing 2"
(with [f (file/open "unique.txt" :w)]
(os/execute [janet "-e" `(repeat 20 (print :hello))`] :p {:out f})
(file/flush f)))
# Issue #593
(assert-no-error "file writing 3"
(def outfile (file/open "unique.txt" :w))
(os/execute [janet "-e" "(pp (seq [i :range (1 10)] i))"] :p {:out outfile})
(file/flush outfile)
(file/close outfile)
(os/rm "unique.txt"))
# ev/gather
(assert (deep= @[1 2 3] (ev/gather 1 2 3)) "ev/gather 1")