diff options
Diffstat (limited to 'lua-resty-shell-0.03/t/stdin.t')
-rw-r--r-- | lua-resty-shell-0.03/t/stdin.t | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lua-resty-shell-0.03/t/stdin.t b/lua-resty-shell-0.03/t/stdin.t new file mode 100644 index 0000000..4ee38fd --- /dev/null +++ b/lua-resty-shell-0.03/t/stdin.t @@ -0,0 +1,39 @@ +# vi:ft= + +use lib '.'; +use t::TestShell; + +plan tests => 3 * blocks(); + +no_long_string(); +#no_diff(); + +run_tests(); + +__DATA__ + +=== TEST 1: good case +--- config + location = /t { + content_by_lua_block { + local say = ngx.say + local shell = require "resty.shell" + + do + local ok, stdout, stderr, reason, status = + shell.run([[perl -e 'my $ln = <>; print $ln']], "hello", 3000) + say("ok: ", ok) + say("stdout: ", stdout) + say("stderr: ", stderr) + say("reason: ", reason) + say("status: ", status) + end + collectgarbage() + } + } +--- response_body +ok: true +stdout: hello +stderr: +reason: exit +status: 0 |