summaryrefslogtreecommitdiff
path: root/dist/if/t/if.t
diff options
context:
space:
mode:
Diffstat (limited to 'dist/if/t/if.t')
-rw-r--r--dist/if/t/if.t10
1 files changed, 9 insertions, 1 deletions
diff --git a/dist/if/t/if.t b/dist/if/t/if.t
index e55bca3c9c..4a2b351aaf 100644
--- a/dist/if/t/if.t
+++ b/dist/if/t/if.t
@@ -1,7 +1,7 @@
#!./perl
use strict;
-use Test::More tests => 6;
+use Test::More tests => 10;
my $v_plus = $] + 1;
my $v_minus = $] - 1;
@@ -30,3 +30,11 @@ like( $@, qr/while "strict refs" in use/, 'expected error message'),
# Use 'open' =>, since pre-5.6.0 could interpret differently
is( (eval "use if ($v_plus > \$]), 'open' => IN => ':crlf'; 12" || 0), 12,
'"use if" with open');
+
+is(eval "use if ($v_plus > \$])", undef,
+ "Too few args to 'use if' returns <undef>");
+like($@, qr/Too few arguments to 'use if'/, " ... and returns correct error");
+
+is(eval "no if ($v_plus > \$])", undef,
+ "Too few args to 'no if' returns <undef>");
+like($@, qr/Too few arguments to 'no if'/, " ... and returns correct error");