summaryrefslogtreecommitdiff
path: root/t/release-pp-27-string-as-type.t
diff options
context:
space:
mode:
Diffstat (limited to 't/release-pp-27-string-as-type.t')
-rw-r--r--t/release-pp-27-string-as-type.t43
1 files changed, 43 insertions, 0 deletions
diff --git a/t/release-pp-27-string-as-type.t b/t/release-pp-27-string-as-type.t
new file mode 100644
index 0000000..bb19f37
--- /dev/null
+++ b/t/release-pp-27-string-as-type.t
@@ -0,0 +1,43 @@
+
+
+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 Params::Validate qw(validate);
+use Test::More;
+
+{
+ my @p = ( foo => 1 );
+
+ eval { validate( @p, { foo => { type => 'SCALAR' } }, ); };
+
+ like(
+ $@,
+ qr/\QThe 'foo' parameter ("1") has a type specification which is not a number. It is a string - SCALAR/
+ );
+}
+
+{
+ my @p = ( foo => 1 );
+
+ eval { validate( @p, { foo => { type => undef } }, ); };
+
+ like(
+ $@,
+ qr/\QThe 'foo' parameter ("1") has a type specification which is not a number. It is undef/
+ );
+
+}
+
+done_testing();
+