blob: feec1412985e1654fdb3242ef1c533147a32c104 (
plain)
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
|
use Test::More;
BEGIN {
unless ( $ENV{RELEASE_TESTING} ) {
plan skip_all => 'these tests are for release testing';
}
$ENV{PV_TEST_PERL} = 1;
}
use strict;
use warnings;
use Test::More 0.88;
use Params::Validate qw( :all );
default_test();
done_testing();
sub default_test {
my ( $first, $second ) = validate_pos(
@_,
{ type => SCALAR, optional => 1 },
{ type => SCALAR, optional => 1, default => 'must be second one' },
);
is( $first, undef, '01 no default for first' );
is( $second, 'must be second one', '01 default for second' );
}
|