mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
test: add more tests for ccunix subprocess handling
This commit is contained in:
parent
e92b4bcef4
commit
a25656edd7
1 changed files with 13 additions and 0 deletions
|
|
@ -123,6 +123,19 @@ let call_full ?bufsize ?stdin ?env cmd =
|
|||
call_full ~stdin:(`Str "abc") "cat" |> stdout = "abc"
|
||||
call_full "echo %s" (escape_str "a'b'c") |> stdout = "a'b'c\n"
|
||||
call_full "echo %s" "a'b'c" |> stdout = "abc\n"
|
||||
String.length (call_full "yes | head -n 100000 1>&2" |> stderr) > 100000
|
||||
*)
|
||||
|
||||
(*$R
|
||||
let p = call_full "for i in `seq 1 10000` ; do echo $i ; echo $i >&2 ; done" in
|
||||
assert_equal ~printer:Q.Print.(list string)
|
||||
(CCString.split_on_char '\n' p#stdout |> List.map String.trim
|
||||
|> List.filter (fun s->s<>""))
|
||||
CCList.(1 -- 10000 |> List.map string_of_int);
|
||||
assert_equal ~printer:Q.Print.(list string)
|
||||
(CCString.split_on_char '\n' p#stderr |> List.map String.trim
|
||||
|> List.filter (fun s->s<>""))
|
||||
CCList.(1 -- 10000 |> List.map string_of_int);
|
||||
*)
|
||||
|
||||
let call ?bufsize ?stdin ?env cmd =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue