File: 04_default_and_action.t

package info (click to toggle)
libgetopt-ex-hashed-perl 1.0601-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 312 kB
  • sloc: perl: 408; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 417 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use strict;
use warnings;
use Test::More;
use lib './t';

my @argv = qw(
    --restaurant Milliways
    );

BEGIN {
    no warnings 'once';
    $App::Foo::DEFAULT_AND_ACTION = 1;
}

use App::Foo;
@argv = (my $app = App::Foo->new)->run(@argv);

is($app->{restaurant}, "Milliways at the end of universe.", "default and action (called)");
is($app->{shop}, "Pizza Hat", "default and action (not called)");

done_testing;