Skip to content

Commit

Permalink
Merge pull request #6 from pghmcfc/copied
Browse files Browse the repository at this point in the history
Cope with GLD output changes in version 0.099
  • Loading branch information
gfx committed Apr 1, 2015
2 parents 1381c86 + 0dd12cc commit ffd3e88
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
7 changes: 7 additions & 0 deletions t/104_override_usage.t
Expand Up @@ -43,10 +43,17 @@ use Test::Exception;
my $exp = [
'Unknown option: q
',
$Getopt::Long::Descriptive::VERSION < 0.099 ?
qq{usage: 104_override_usage.t [-?] [long options...]
\t-? --usage --help Prints this usage information.
\t--foo A foo
}
:
qq{usage: 104_override_usage.t [-?] [long options...]
\t-? --usage --help Prints this usage information.
\t--foo INT A foo
}

];

is_deeply \@MyScript::exception, $exp;
Expand Down
2 changes: 1 addition & 1 deletion t/107_no_auto_help.t
Expand Up @@ -60,7 +60,7 @@ END {
warning_like {
throws_ok { Class->new_with_options }
#usage: 107_no_auto_help.t [-?] [long options...]
qr/^usage: [\d\w]+\Q.t [-?] [long options...]\E.\s+\Q-? --usage --help Prints this usage information.\E.\s+--configfile/ms,
qr/^usage: [\d\w]+\Q.t [-?] [long options...]\E.\s+\Q-? --usage --help\E\s+\QPrints this usage information.\E.\s+--configfile/ms,
'usage information looks good';
}
qr/^Specified configfile \'this_value_unimportant\' does not exist, is empty, or is not readable$/,
Expand Down
2 changes: 1 addition & 1 deletion t/109_help_flag.t
Expand Up @@ -40,7 +40,7 @@ foreach my $args ( ['--help'], ['--usage'], ['--?'], ['-?'] )
local @ARGV = @$args;

throws_ok { MyClass->new_with_options() }
qr/^usage: (?:[\d\w]+)\Q.t [-?] [long options...]\E.^\t\Q-? --usage --help Prints this usage information.\E$/ms,
qr/^usage: (?:[\d\w]+)\Q.t [-?] [long options...]\E.^\t\Q-? --usage --help\E\s+\QPrints this usage information.\E$/ms,
'Help request detected; usage information properly printed';
}

Expand Down
10 changes: 10 additions & 0 deletions t/110_sort_usage_by_attr_order.t
Expand Up @@ -34,6 +34,16 @@ usage: 110_sort_usage_by_attr_order.t [-?] [long options...]
--bar Documentation for "bar"
--baz Documentation for "baz"
USAGE
if ( $Getopt::Long::Descriptive::VERSION >= 0.099 )
{
$expected = <<'USAGE';
usage: 110_sort_usage_by_attr_order.t [-?] [long options...]
-? --usage --help Prints this usage information.
--foo STR Documentation for "foo"
--bar STR Documentation for "bar"
--baz STR Documentation for "baz"
USAGE
}
$expected =~ s/^[ ]{4}/\t/xmsg;
is($obj->usage->text, $expected, 'Usage text has nicely sorted options');

0 comments on commit ffd3e88

Please sign in to comment.