summaryrefslogtreecommitdiff
path: root/test/exec.t
diff options
context:
space:
mode:
authorChristian Schneider2024-04-22 18:29:14 +0200
committerChristian Schneider2024-04-22 18:29:14 +0200
commitdc7b8557d6bbcbdcef9874ff199bf93a39a11c32 (patch)
tree4796554bc48cdb4358147872a35f93f6afb14d3f /test/exec.t
parent813faa732349886b6adae00c44eb436e16809689 (diff)
downloaditools-dc7b8557d6bbcbdcef9874ff199bf93a39a11c32.tar.gz
itools-dc7b8557d6bbcbdcef9874ff199bf93a39a11c32.tar.bz2
itools-dc7b8557d6bbcbdcef9874ff199bf93a39a11c32.zip
Add test to ensure and document that leading dashes are not allowed in non-option args even with -- in command line
Diffstat (limited to 'test/exec.t')
-rwxr-xr-xtest/exec.t1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/exec.t b/test/exec.t
index 9e55726..237d59b 100755
--- a/test/exec.t
+++ b/test/exec.t
@@ -14,6 +14,7 @@ is(it::shell_command("echo {arg}", ['arg' => false]), "echo ", "remove
is(it::shell_command("echo {arg}", ['arg' => []]), "echo ", "remove empty arrays");
is(it::shell_command("echo {arg}", (object)['arg' => "foo"]) , "echo foo", "allow objects");
is(it::shell_command("echo {arg}", ['arg' => 1], ['arg' => 2]), "echo 2", "support varargs");
+errlike(fn() => it::shell_command("echo -- $(echo {arg})", ['arg' => "-1"]), "leading - in value", "disallow leading dash in non-option args");
is(