Skip to content

Commit f861ba6

Browse files
author
Father Chrysostomos
committed
startkve.t: Refactor setting of $errpat
This will simplify things in the next commit.
1 parent acfbe60 commit f861ba6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

t/op/smartkve.t

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ plan 'no_plan';
1414

1515
my $empty;
1616

17+
sub set_errpat {
18+
$errpat = qr/Experimental $_[0] on scalar is now forbidden/;
19+
}
20+
1721
# Keys -- errors
18-
$errpat = qr/Experimental keys on scalar is now forbidden/;
22+
set_errpat 'keys';
1923

2024
eval "keys undef";
2125
like($@, $errpat,
@@ -46,7 +50,7 @@ like($@, $errpat,
4650
) or print "# Got: $@";
4751

4852
# Values -- errors
49-
$errpat = qr/Experimental values on scalar is now forbidden/;
53+
set_errpat 'values';
5054

5155
eval "values undef";
5256
like($@, $errpat,
@@ -77,7 +81,7 @@ like($@, $errpat,
7781
) or print "# Got: $@";
7882

7983
# Each -- errors
80-
$errpat = qr/Experimental each on scalar is now forbidden/;
84+
set_errpat 'each';
8185

8286
eval "each undef";
8387
like($@, $errpat,

0 commit comments

Comments
 (0)