File: 101_argv_bug.t

package info (click to toggle)
libmousex-getopt-perl 0.38-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 364 kB
  • sloc: perl: 1,550; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 615 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env perl

use strict;
use warnings;

use Test::More tests => 3;

use MouseX::Getopt;

{
    package App;
    use Mouse;

    with 'MouseX::Getopt';

    has 'length' => (
        is      => 'ro',
        isa     => 'Int',
        default => 24,
    );

    has 'verbose' => (
        is     => 'ro',
        isa    => 'Bool',
        default => 0,
    );
    no Mouse;
}

{
    my $app = App->new_with_options(argv => [ '--verbose', '--length', 50 ]);
    isa_ok($app, 'App');

    ok($app->verbose, '... verbosity is turned on as expected');
    is($app->length, 50, '... length is 50 as expected');
}