diff options
author | Urban Müller | 2018-06-21 16:42:32 +0200 |
---|---|---|
committer | Urban Müller | 2018-06-21 16:43:32 +0200 |
commit | 3dabbbd5325c9fad9582cd44b1da68dece78eaa0 (patch) | |
tree | 92d951b948f0e01dc6b7ae3f11b9c03034edb69a /tests/getopt.t | |
parent | 455b15f7a850a58ef667ad170732769043eb1522 (diff) | |
download | itools-3dabbbd5325c9fad9582cd44b1da68dece78eaa0.tar.gz itools-3dabbbd5325c9fad9582cd44b1da68dece78eaa0.tar.bz2 itools-3dabbbd5325c9fad9582cd44b1da68dece78eaa0.zip |
no reason for different naming
Diffstat (limited to 'tests/getopt.t')
-rwxr-xr-x | tests/getopt.t | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/tests/getopt.t b/tests/getopt.t deleted file mode 100755 index d67738d..0000000 --- a/tests/getopt.t +++ /dev/null @@ -1,29 +0,0 @@ -#!/www/server/bin/php -qC -<?php - -# Tests for getopt in it.class - -$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) -{ - $_SERVER['argv'] = array_merge(array('doesnotexist.php'), $argv); - $got = it::getopt($GLOBALS['usage']); - return is($got['argument'], $exp, $name); -} - -foreach (array("" => "blah gnaber", " (umlaute)" => "pre üäpost") as $variant => $testarg) { - getopt_ok(array('-a', $testarg), $testarg, "Short version" . $variant); - 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'); - |