File: release-pp-25-undef-regex.t

package info (click to toggle)
libparams-validate-perl 1.06-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 776 kB
  • sloc: perl: 2,179; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 495 bytes parent folder | download | duplicates (2)
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


use Test::More;

BEGIN {
    unless ( $ENV{RELEASE_TESTING} ) {
        plan skip_all => 'these tests are for testing by the release';
    }

    $ENV{PV_TEST_PERL} = 1;
}

use strict;
use warnings;

use Params::Validate qw(validate);
use Test::More;

{
    my @w;
    local $SIG{__WARN__} = sub { push @w, @_ };

    my @p = ( foo => undef );
    eval { validate( @p, { foo => { regex => qr/^bar/ } } ) };
    ok( $@,  'validation failed' );
    ok( !@w, 'no warnings' );
}

done_testing();