From 5a851f4b1cf607534ebfcae2e66ec9e6c4be8ada Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Fri, 2 Jan 2015 17:01:50 -0500 Subject: [PATCH] tests: update test_exec.nit Signed-off-by: Jean Privat --- tests/sav/test_exec.res | 13 ++++++++++++- tests/test_exec.nit | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/tests/sav/test_exec.res b/tests/sav/test_exec.res index 2f109dd..3647533 100644 --- a/tests/sav/test_exec.res +++ b/tests/sav/test_exec.res @@ -1,3 +1,14 @@ A hello world! +0 + +B hello world!0 + C hello world! -B hello world!D hello world! \ No newline at end of file +0 + +D hello world!0 + +E +1 + +127 diff --git a/tests/test_exec.nit b/tests/test_exec.nit index 4a1a749..da3bf84 100644 --- a/tests/test_exec.nit +++ b/tests/test_exec.nit @@ -18,19 +18,43 @@ import exec var hw = new Process("echo", "A", "hello", "world!") hw.wait +print hw.status + +print "" var ip = new IProcess("echo", "B hello world!") ip.read_line.output ip.wait +print ip.status + +print "" var op = new OProcess.from_a("cat", null) op.write("C hello world!\n") op.close op.wait +print op.status + +print "" var iop = new IOProcess.from_a("cat", null) iop.write("D hello world!\n") iop.read_line.output iop.close iop.wait +print iop.status + +print "" + +var e1 = new Process("sh", "-c", "echo E; exit 1") +e1.wait +print e1.status + +print "" +var ioperr = new IOProcess.from_a("bad command", null) +ioperr.write("D hello world!\n") +ioperr.read_line.output +ioperr.close +ioperr.wait +print ioperr.status -- 1.7.9.5