summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2016-04-24 17:21:44 -0700
committerFather Chrysostomos <sprout@cpan.org>2016-05-16 20:22:02 -0700
commitf861ba6781c5332f6aee9858ce7f69b9ff26f55f (patch)
tree8995e8ca2bae87cd00d95d79911e386e063b6d1e
parentacfbe606c0d84540e21a464268c3bc88bc187789 (diff)
downloadperl-f861ba6781c5332f6aee9858ce7f69b9ff26f55f.tar.gz
startkve.t: Refactor setting of $errpat
This will simplify things in the next commit.
-rw-r--r--t/op/smartkve.t10
1 files changed, 7 insertions, 3 deletions
diff --git a/t/op/smartkve.t b/t/op/smartkve.t
index f761b4c953..c57bc6843a 100644
--- a/t/op/smartkve.t
+++ b/t/op/smartkve.t
@@ -14,8 +14,12 @@ plan 'no_plan';
my $empty;
+sub set_errpat {
+ $errpat = qr/Experimental $_[0] on scalar is now forbidden/;
+}
+
# Keys -- errors
-$errpat = qr/Experimental keys on scalar is now forbidden/;
+set_errpat 'keys';
eval "keys undef";
like($@, $errpat,
@@ -46,7 +50,7 @@ like($@, $errpat,
) or print "# Got: $@";
# Values -- errors
-$errpat = qr/Experimental values on scalar is now forbidden/;
+set_errpat 'values';
eval "values undef";
like($@, $errpat,
@@ -77,7 +81,7 @@ like($@, $errpat,
) or print "# Got: $@";
# Each -- errors
-$errpat = qr/Experimental each on scalar is now forbidden/;
+set_errpat 'each';
eval "each undef";
like($@, $errpat,