diff options
author | Sami Kerola | 2014-12-04 23:39:21 +0100 |
---|---|---|
committer | Sami Kerola | 2014-12-08 21:07:00 +0100 |
commit | 93575f2943332d18e8b49441f9519ba2a093e0c3 (patch) | |
tree | 3a3f67e43fa9ff470f8985f5e8cb26a76d6392d0 /tests/expected/misc | |
parent | getopt: sync with 1.1.6 release (diff) | |
download | kernel-qcow2-util-linux-93575f2943332d18e8b49441f9519ba2a093e0c3.tar.gz kernel-qcow2-util-linux-93575f2943332d18e8b49441f9519ba2a093e0c3.tar.xz kernel-qcow2-util-linux-93575f2943332d18e8b49441f9519ba2a093e0c3.zip |
tests: copy test-suite from Frodo Looijaard's getopt
The test cases and their names are the same, but the surrounding testing
facility with Frodo's svn and util-linux are pretty different so this is
not exactly 1:1 copy.
Reference: svn://svn.frodo.looijaard.name/public/getopt/trunk/tests
CC: Frodo Looijaard <frodo@frodo.looijaard.name>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'tests/expected/misc')
24 files changed, 88 insertions, 0 deletions
diff --git a/tests/expected/misc/getopt2 b/tests/expected/misc/getopt2 new file mode 100644 index 000000000..59ec59bbf --- /dev/null +++ b/tests/expected/misc/getopt2 @@ -0,0 +1,19 @@ +exit value: 0 +exit value: 0 +exit value: 0 +exit value: 1 +exit value: 0 +exit value: 0 +exit value: 0 +exit value: 0 +exit value: 1 +exit value: 0 +exit value: 0 +exit value: 0 +exit value: 0 +exit value: 0 +exit value: 1 +exit value: 1 +exit value: 0 +exit value: 0 +exit value: 1 diff --git a/tests/expected/misc/getopt2-alternative_option_clash b/tests/expected/misc/getopt2-alternative_option_clash new file mode 100644 index 000000000..04ae19de0 --- /dev/null +++ b/tests/expected/misc/getopt2-alternative_option_clash @@ -0,0 +1,2 @@ + -a --abcde --abcde -a -c -- +exit value: 0 diff --git a/tests/expected/misc/getopt2-alternative_option_long b/tests/expected/misc/getopt2-alternative_option_long new file mode 100644 index 000000000..0f5fc19c0 --- /dev/null +++ b/tests/expected/misc/getopt2-alternative_option_long @@ -0,0 +1,2 @@ + -a --one --two 'MANDATORY' --three 'OPTIONAL' -- +exit value: 0 diff --git a/tests/expected/misc/getopt2-alternative_option_short b/tests/expected/misc/getopt2-alternative_option_short new file mode 100644 index 000000000..0f5fc19c0 --- /dev/null +++ b/tests/expected/misc/getopt2-alternative_option_short @@ -0,0 +1,2 @@ + -a --one --two 'MANDATORY' --three 'OPTIONAL' -- +exit value: 0 diff --git a/tests/expected/misc/getopt2-invalid_getopt_option b/tests/expected/misc/getopt2-invalid_getopt_option new file mode 100644 index 000000000..531cc9828 --- /dev/null +++ b/tests/expected/misc/getopt2-invalid_getopt_option @@ -0,0 +1,3 @@ +getopt: invalid option -- 'b' +Try `getopt --help' for more information. +exit value: 2 diff --git a/tests/expected/misc/getopt2-invocation_model_one b/tests/expected/misc/getopt2-invocation_model_one new file mode 100644 index 000000000..ca4ddca90 --- /dev/null +++ b/tests/expected/misc/getopt2-invocation_model_one @@ -0,0 +1,2 @@ + -b -d -e OPTIONAL1 -f -a -c -ISREQUIRED -g BECOMES THREE ARGUMENTS -- ARG0 ARG1 NOT_OPTIONAL ARG2 ARG3 +exit value: 0 diff --git a/tests/expected/misc/getopt2-invocation_model_three_as_one b/tests/expected/misc/getopt2-invocation_model_three_as_one new file mode 100644 index 000000000..1d4701f5c --- /dev/null +++ b/tests/expected/misc/getopt2-invocation_model_three_as_one @@ -0,0 +1,2 @@ + -b -d '' -e 'OPTIONAL1' -f '' -a -c '-ISREQUIRED' -g 'BECOMES THREE ARGUMENTS' -- 'ARG0' 'ARG1' 'NOT_OPTIONAL' 'ARG2' 'ARG3' +exit value: 0 diff --git a/tests/expected/misc/getopt2-invocation_model_two_as_one b/tests/expected/misc/getopt2-invocation_model_two_as_one new file mode 100644 index 000000000..1d4701f5c --- /dev/null +++ b/tests/expected/misc/getopt2-invocation_model_two_as_one @@ -0,0 +1,2 @@ + -b -d '' -e 'OPTIONAL1' -f '' -a -c '-ISREQUIRED' -g 'BECOMES THREE ARGUMENTS' -- 'ARG0' 'ARG1' 'NOT_OPTIONAL' 'ARG2' 'ARG3' +exit value: 0 diff --git a/tests/expected/misc/getopt2-invocation_without_parameters b/tests/expected/misc/getopt2-invocation_without_parameters new file mode 100644 index 000000000..08b3ed5cf --- /dev/null +++ b/tests/expected/misc/getopt2-invocation_without_parameters @@ -0,0 +1,3 @@ +getopt: missing optstring argument +Try `getopt --help' for more information. +exit value: 2 diff --git a/tests/expected/misc/getopt2-long_option_ambiguous_1 b/tests/expected/misc/getopt2-long_option_ambiguous_1 new file mode 100644 index 000000000..c8cfbb3d9 --- /dev/null +++ b/tests/expected/misc/getopt2-long_option_ambiguous_1 @@ -0,0 +1,3 @@ +getopt: option '--long' is ambiguous; possibilities: '--long1' '--long2' + -- +exit value: 1 diff --git a/tests/expected/misc/getopt2-longopts b/tests/expected/misc/getopt2-longopts new file mode 100644 index 000000000..379b5abc1 --- /dev/null +++ b/tests/expected/misc/getopt2-longopts @@ -0,0 +1,2 @@ + --long1 --thirdlong 'ARGUMENT' --secondlong 'ARG' --abbriviation 'ABBRARG' -a -- 'EXTRA1' +exit value: 0 diff --git a/tests/expected/misc/getopt2-name_option_long b/tests/expected/misc/getopt2-name_option_long new file mode 100644 index 000000000..60b9e6b7b --- /dev/null +++ b/tests/expected/misc/getopt2-name_option_long @@ -0,0 +1,4 @@ +THIS_PROGRAM: invalid option -- 'b' +THIS_PROGRAM: unrecognized option '--whatever' + --long -a -- +exit value: 1 diff --git a/tests/expected/misc/getopt2-name_option_short b/tests/expected/misc/getopt2-name_option_short new file mode 100644 index 000000000..60b9e6b7b --- /dev/null +++ b/tests/expected/misc/getopt2-name_option_short @@ -0,0 +1,4 @@ +THIS_PROGRAM: invalid option -- 'b' +THIS_PROGRAM: unrecognized option '--whatever' + --long -a -- +exit value: 1 diff --git a/tests/expected/misc/getopt2-quiet_option_long b/tests/expected/misc/getopt2-quiet_option_long new file mode 100644 index 000000000..3e1a9672a --- /dev/null +++ b/tests/expected/misc/getopt2-quiet_option_long @@ -0,0 +1,2 @@ + -- +exit value: 1 diff --git a/tests/expected/misc/getopt2-quiet_option_short b/tests/expected/misc/getopt2-quiet_option_short new file mode 100644 index 000000000..3e1a9672a --- /dev/null +++ b/tests/expected/misc/getopt2-quiet_option_short @@ -0,0 +1,2 @@ + -- +exit value: 1 diff --git a/tests/expected/misc/getopt2-quiet_output_option_long b/tests/expected/misc/getopt2-quiet_output_option_long new file mode 100644 index 000000000..3e05ca7df --- /dev/null +++ b/tests/expected/misc/getopt2-quiet_output_option_long @@ -0,0 +1,5 @@ +getopt: invalid option -- 'c' +getopt: unrecognized option '--unknown' +getopt: option '--long' is ambiguous; possibilities: '--long1' '--long2' +getopt: option requires an argument -- 'b' +exit value: 1 diff --git a/tests/expected/misc/getopt2-quiet_output_option_short b/tests/expected/misc/getopt2-quiet_output_option_short new file mode 100644 index 000000000..3e05ca7df --- /dev/null +++ b/tests/expected/misc/getopt2-quiet_output_option_short @@ -0,0 +1,5 @@ +getopt: invalid option -- 'c' +getopt: unrecognized option '--unknown' +getopt: option '--long' is ambiguous; possibilities: '--long1' '--long2' +getopt: option requires an argument -- 'b' +exit value: 1 diff --git a/tests/expected/misc/getopt2-same_long_short_options b/tests/expected/misc/getopt2-same_long_short_options new file mode 100644 index 000000000..919d2276b --- /dev/null +++ b/tests/expected/misc/getopt2-same_long_short_options @@ -0,0 +1,2 @@ + -a --a -- +exit value: 0 diff --git a/tests/expected/misc/getopt2-test_for_enhanced_getopt b/tests/expected/misc/getopt2-test_for_enhanced_getopt new file mode 100644 index 000000000..539db061d --- /dev/null +++ b/tests/expected/misc/getopt2-test_for_enhanced_getopt @@ -0,0 +1 @@ +exit value: 4 diff --git a/tests/expected/misc/getopt2-unknown_options b/tests/expected/misc/getopt2-unknown_options new file mode 100644 index 000000000..6edba2b77 --- /dev/null +++ b/tests/expected/misc/getopt2-unknown_options @@ -0,0 +1,4 @@ +getopt: invalid option -- 'b' +getopt: unrecognized option '--whatever' + --long -a -- +exit value: 1 diff --git a/tests/expected/misc/getopt2-unquoted_option_bash b/tests/expected/misc/getopt2-unquoted_option_bash new file mode 100644 index 000000000..8da362fe8 --- /dev/null +++ b/tests/expected/misc/getopt2-unquoted_option_bash @@ -0,0 +1,5 @@ + -a $?!* --long1 "\' -- More + than +one +line +exit value: 0 diff --git a/tests/expected/misc/getopt2-unquoted_option_tcsh b/tests/expected/misc/getopt2-unquoted_option_tcsh new file mode 100644 index 000000000..8da362fe8 --- /dev/null +++ b/tests/expected/misc/getopt2-unquoted_option_tcsh @@ -0,0 +1,5 @@ + -a $?!* --long1 "\' -- More + than +one +line +exit value: 0 diff --git a/tests/expected/misc/getopt2-weird_quoting_bash b/tests/expected/misc/getopt2-weird_quoting_bash new file mode 100644 index 000000000..db871ce13 --- /dev/null +++ b/tests/expected/misc/getopt2-weird_quoting_bash @@ -0,0 +1,5 @@ + -a '$?!* ' --long1 '"\'\''' -- 'More + than +one +line' +exit value: 0 diff --git a/tests/expected/misc/getopt2-weird_quoting_tcsh b/tests/expected/misc/getopt2-weird_quoting_tcsh new file mode 100644 index 000000000..9e5b71da0 --- /dev/null +++ b/tests/expected/misc/getopt2-weird_quoting_tcsh @@ -0,0 +1,2 @@ + -a '$?'\!'*'\ '' --long1 '"\\'\''' -- 'More\n'\ 'than\none\nline' +exit value: 0 |