diff options
Diffstat (limited to 'tests/exec.t')
-rwxr-xr-x | tests/exec.t | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/exec.t b/tests/exec.t index 349f0ed..6418716 100755 --- a/tests/exec.t +++ b/tests/exec.t @@ -22,3 +22,20 @@ foreach (array("", "C", "de_CH", "de_CH.utf8") as $locale) { is(it::_exec_quotevalue(""), "''", "empty arg needs quotes"); is(it::_exec_quotevalue("*"), "'*'", "special chars need quotes"); is(it::_exec_quotevalue("Aabcdef0123456789"), "Aabcdef0123456789", "simple case. tel:debug_getdata needs unquoted vals"); + +is(it::system('exit 0'), 0, 'return exit code 0'); +is(it::system('exit 1'), 1, 'return exit code 1'); +is(it::system('exit -1'), 255, 'return exit code unsigned'); + +@unlink('/tmp/it_system_test'); +it::system('touch /tmp/it_system_test'); +ok(file_exists('/tmp/it_system_test'), 'shell command gets executed'); + +@unlink('/tmp/it_system_test'); +it::system('touch {path}', 'path' => '/tmp/it_system_test'); +ok(file_exists('/tmp/it_system_test'), 'shell command with argument'); + +@unlink('/tmp/it_system_test'); +it::system('touch {0}', '/tmp/it_system_test'); +ok(file_exists('/tmp/it_system_test'), 'shell command with positional argument'); +@unlink('/tmp/it_system_test'); |