summaryrefslogtreecommitdiff
path: root/t/25-undef-regex.t
diff options
context:
space:
mode:
Diffstat (limited to 't/25-undef-regex.t')
-rw-r--r--t/25-undef-regex.t17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/25-undef-regex.t b/t/25-undef-regex.t
new file mode 100644
index 0000000..64fe996
--- /dev/null
+++ b/t/25-undef-regex.t
@@ -0,0 +1,17 @@
+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();