From e79ea1263b41976cb53ebba155f6d0b541e69602 Mon Sep 17 00:00:00 2001 From: Christian Helbling Date: Thu, 8 Dec 2011 13:22:21 +0000 Subject: allow -0 as shortarg in getopt --- tests/getopt.t | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/getopt.t b/tests/getopt.t index 56974fe..7a84588 100755 --- a/tests/getopt.t +++ b/tests/getopt.t @@ -7,6 +7,7 @@ $GLOBALS['usage'] = "Usage: doesnotexist.php [OPTIONS] Some help to a not existing program -h,--help the help argument -a,--argument=ARG the arg argument + -0,--zero testworthy shortarg "; function getopt_ok($argv, $exp, $name) @@ -21,3 +22,8 @@ foreach (array("" => "blah gnaber", " (umlaute)" => "pre getopt_ok(array('--argument', $testarg), $testarg, "Long version with space" . $variant); getopt_ok(array("--argument=$testarg"), $testarg, "Long version with equal" . $variant); } + +$_SERVER['argv'] = array('doesnotexist.php', '-0'); +$zero_opts = it::getopt($GLOBALS['usage']); +ok($zero_opts['zero'], '-0'); + -- cgit v1.2.3