2 # Copyright (C) 2007, Parrot Foundation.
4 # 03-handle_long_options.t
12 use Parrot::Config qw( %PConfig );
14 plan( skip_all => 't/harness only runs once configuration has completed' )
18 use Parrot::Harness::Options qw( handle_long_options );
20 my (@argv, $longopts);
29 ($longopts, @argv) = handle_long_options(@argv);
30 ok($longopts->{gc_debug}, "Captured long option");
31 %still_argv = map {$_, 1} @argv;
32 ok($still_argv{'-wv'}, "Combined short options still present in \@ARGV");
33 ok($still_argv{'-O2'}, "Short options with values still present in \@ARGV");
34 ok($still_argv{'t/postconfigure/*.t'}, "Arguments still present in \@ARGV");
41 ($longopts, @argv) = handle_long_options(@argv);
42 ok($longopts->{archive}, "Captured long option");
43 ok(! $longopts->{send_to_smolder}, "Smolder test not requested");
44 %still_argv = map {$_, 1} @argv;
45 ok($still_argv{'t/postconfigure/*.t'}, "Arguments still present in \@ARGV");
53 ($longopts, @argv) = handle_long_options(@argv);
54 ok($longopts->{archive}, "Captured long option");
55 ok($longopts->{send_to_smolder}, "Smolder test requested");
56 %still_argv = map {$_, 1} @argv;
57 ok($still_argv{'t/postconfigure/*.t'}, "Arguments still present in \@ARGV");
59 pass("Completed all tests in $0");
61 ################### DOCUMENTATION ###################
65 03-handle_long_options.t - test Parrot::Harness::Options
69 % prove t/pharness/03-handle_long_options.t
73 This file holds tests for Parrot::Harness::Options::handle_long_options().
81 Parrot::Harness::Options, F<t/harness>.
87 # cperl-indent-level: 4
90 # vim: expandtab shiftwidth=4: