diff options
author | Guillem Jover <guillem@debian.org> | 2017-09-16 13:43:52 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2017-10-17 02:28:09 +0200 |
commit | 2e344c2119c5a55a3180ddd61c67f8a657520ceb (patch) | |
tree | 12b0d2283eff98a90b1c350cc2f0fab5a5d7d614 /scripts/t | |
parent | e23943051599ff21e6ca955ac8e5ead4cda1891c (diff) | |
download | dpkg-2e344c2119c5a55a3180ddd61c67f8a657520ceb.tar.gz |
Dpkg::Getopt: Do not normalize args past a passthrough stop word
Some commands pass some arguments through to another command, and those
must not be normalized as that might break their invocation.
Reported-by: Helmut Grohne <helmut@subdivi.de>
Stable-Candidate: 1.17.x 1.18.x
Diffstat (limited to 'scripts/t')
-rw-r--r-- | scripts/t/Dpkg_Getopt.t | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/t/Dpkg_Getopt.t b/scripts/t/Dpkg_Getopt.t index 186679636..32edeec53 100644 --- a/scripts/t/Dpkg_Getopt.t +++ b/scripts/t/Dpkg_Getopt.t @@ -16,7 +16,7 @@ use strict; use warnings; -use Test::More tests => 3; +use Test::More tests => 4; BEGIN { use_ok('Dpkg::Getopt'); @@ -24,12 +24,17 @@ BEGIN { my @expect_argv; -@ARGV = normalize_options(qw(-a -bfoo -c var)); +@ARGV = normalize_options(args => [ qw(-a -bfoo -c var) ]); @expect_argv = qw(-a -b foo -c var); is_deeply(\@ARGV, \@expect_argv, 'unbundle short options'); -@ARGV = normalize_options(qw(--option-a --option-b value --option-c=value)); +@ARGV = normalize_options(args => [ qw(--option-a --option-b value --option-c=value) ]); @expect_argv = qw(--option-a --option-b value --option-c value); is_deeply(\@ARGV, \@expect_argv, 'unbundle long options'); +@ARGV = normalize_options(args => [ qw(-aaa -bbb --option-a=oa -- --opt=arg -dval) ], + delim => '--'); +@expect_argv = qw(-a aa -b bb --option-a oa -- --opt=arg -dval); +is_deeply(\@ARGV, \@expect_argv, 'unbundle options with delimiter'); + 1; |