From 854b10224fb8735c6fc85bc426aa223faedb2b2f Mon Sep 17 00:00:00 2001 From: Nathan Gass Date: Tue, 7 Jun 2011 13:54:32 +0000 Subject: add some it::shell_command tests for new complex behaviour --- tests/exec.t | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/exec.t b/tests/exec.t index 05aac98..941e0c0 100755 --- a/tests/exec.t +++ b/tests/exec.t @@ -5,6 +5,9 @@ is(it::exec("echo gna"), "gna\n", "basic exec"); is(it::exec("echo {arg}", array('arg' => 'gna')), "gna\n", "exec with argument"); +is(it::shell_command("echo {arg}", array('arg' => 'gna07,-:blah')), "echo gna07,-:blah", "don't quote arguments with only whitelistes characters"); +is(it::shell_command("echo {arg}", array('arg' => '2>&1')), "echo '2>&1'", "quote arguments with dangerous characters"); +is(it::shell_command("echo {arg}", array('arg' => '')), "echo ''", "quote empty arguments"); foreach (array("", "C", "de_CH", "de_CH.utf8") as $locale) { setlocale(LC_ALL, $locale); -- cgit v1.2.3