summaryrefslogtreecommitdiff
path: root/t/31-incorrect-spelling.t
diff options
context:
space:
mode:
Diffstat (limited to 't/31-incorrect-spelling.t')
-rw-r--r--t/31-incorrect-spelling.t61
1 files changed, 61 insertions, 0 deletions
diff --git a/t/31-incorrect-spelling.t b/t/31-incorrect-spelling.t
new file mode 100644
index 0000000..66cad86
--- /dev/null
+++ b/t/31-incorrect-spelling.t
@@ -0,0 +1,61 @@
+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use Params::Validate qw( validate validate_pos SCALAR );
+
+plan skip_all => 'Spec validation is disabled for now';
+
+{
+ my @p = ( foo => 1, bar => 2 );
+
+ eval {
+ validate(
+ @p, {
+ foo => {
+ type => SCALAR,
+ callbucks => {
+ 'one' => sub {1}
+ },
+ },
+ bar => { type => SCALAR },
+ }
+ );
+ };
+
+ like( $@, qr/is not an allowed validation spec key/ );
+
+ eval {
+ validate(
+ @p, {
+ foo => {
+ hype => SCALAR,
+ callbacks => {
+ 'one' => sub {1}
+ },
+ },
+ bar => { type => SCALAR },
+ }
+ );
+ };
+
+ like( $@, qr/is not an allowed validation spec key/ );
+ eval {
+ validate(
+ @p, {
+ foo => {
+ type => SCALAR,
+ regexp => qr/^\d+$/,
+ },
+ bar => { type => SCALAR },
+ }
+ );
+ };
+
+ like( $@, qr/is not an allowed validation spec key/ );
+}
+
+done_testing();