ProcessesPipeline type
Methods
- assert_exit_code(pp:ProcessesPipeline, expected:Int, title:Str=null)
Assert process exits with the specified exit code. Throws TestFail. Returns
ppExample
p = $(true); assert_exit_code(p, 0) # OK p = $(false); assert_exit_code(p, 1) # OK p = $(false); assert_exit_code(p, 0) # Throws TestFail
- assert_output_has(pp:ProcessesPipeline, expected:RegExp, title:Str=null)
Assert process has given output. Throws TestFail. Example
assert_output_has($(echo abc), /xyz/) # Throws TestFail p = $(echo abc); assert_output_has(p, /c$/) # OK
- assert_output_has(pp:ProcessesPipeline, expected:Str, title:Str=null)
Assert process has given output. Throws TestFail. Example
assert_output_has($(echo abc), "xyz") # Throws TestFail p = $(echo abc); assert_output_has(p, "bc") # OK
- Bool(pp:ProcessesPipeline) Source: stdlib.ngs:6478
Wait for all process to finish and see whether all exit codes are 0 Returns
BoolExample
if $(test -f myfile) ... # if runs Bool() on any non-Bool condition expression
- close(pp:ProcessesPipeline) Source: stdlib.ngs:6977
Close reading and writing pipes of ProcessesPipeline, if they exist
- echo(pp:ProcessesPipeline, s:Str) Source: stdlib.ngs:6959
Write s and newline character(s) to pp
- ExitCode(pp:ProcessesPipeline) Source: stdlib.ngs:6554
Convert ProcessesPipeline to exit code. Waits for the processes to finish. Returns first non-zero exit code. Returns zero if all exit codes are zero.
- init(pp:ProcessesPipeline, cp:CommandsPipeline) Source: stdlib.ngs:5971
Undocumented
- kill(pp:ProcessesPipeline, sig:Int=15) Source: stdlib.ngs:7037
Kill all processes in the ProcessesPipeline. Throws InvalidArgument if ProcessesPipeline is not running (yet).
- lines(pp:ProcessesPipeline) Source: stdlib.ngs:7160
Wait for cp and return lines of stdout of the last process. Returns
Arr of StrExample
$(seq 3 | tac).lines().map(Int) # [3,2,1]
- lines(pp:ProcessesPipeline, cb:Fun) Source: stdlib.ngs:7168
Wait for pp and return call cb for each line of stdout of last process. Warning: current implementation waits for the processes to finish, accumulates all stdout of the last process, and only then starts calling cb for each line. Returns
Arr of Str
- read(pp:ProcessesPipeline, count:Any=null) Source: stdlib.ngs:6969
Read from last process of ProcessesPipeline Example
p = $(seq 3 | tac |); data = read(p); p.close()
- Str(pp:ProcessesPipeline) Source: stdlib.ngs:6563
Wait for the processes to finish and return standard output of the last process in pipeline. Returns
Str
- wait(pp:ProcessesPipeline) Source: stdlib.ngs:6529
Wait for all processes to finish. Returns
pp
- write(pp:ProcessesPipeline, s:Str) Source: stdlib.ngs:6952
Write to first process of ProcessesPipeline Example
p = (|cat -n | tac >/tmp/1) p.write("one\n") p.write("two\n") p.close()