summaryrefslogtreecommitdiff
path: root/t/release-pp-14-no_validate.t
diff options
context:
space:
mode:
Diffstat (limited to 't/release-pp-14-no_validate.t')
-rw-r--r--t/release-pp-14-no_validate.t41
1 files changed, 41 insertions, 0 deletions
diff --git a/t/release-pp-14-no_validate.t b/t/release-pp-14-no_validate.t
new file mode 100644
index 0000000..3549bbf
--- /dev/null
+++ b/t/release-pp-14-no_validate.t
@@ -0,0 +1,41 @@
+
+
+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 lib './t';
+
+use Params::Validate qw(validate);
+
+use Test::More;
+plan tests => $] == 5.006 ? 2 : 3;
+
+eval { foo() };
+like( $@, qr/parameter 'foo'/ );
+
+{
+ local $Params::Validate::NO_VALIDATION = 1;
+
+ eval { foo() };
+ is( $@, q{} );
+}
+
+unless ( $] == 5.006 ) {
+ eval { foo() };
+ like( $@, qr/parameter 'foo'/ );
+}
+
+sub foo {
+ validate( @_, { foo => 1 } );
+}
+