This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Stop cv-to-glob assignment redef warnings from leaking
[perl5.git] / t / op / defined.t
CommitLineData
518618af
FC
1#!perl
2BEGIN {
3 chdir 't';
4 require './test.pl';
5}
6
7plan 5;
8
9sub notdef { undef }
10
11# [perl #97466]
12# These should actually call the sub, instead of testing the sub itself
13ok !defined do { &notdef }, 'defined do { &sub }';
14ok !defined(scalar(42,&notdef)), 'defined(scalar(42,&sub))';
15ok !defined do{();&notdef}, '!defined do{();&sub}';
16
17# Likewise, these should evaluate @array in scalar context
18no warnings "deprecated";
19ok defined($false ? $scalar : @array), 'defined( ... ? ... : @array)';
20ok defined(scalar @array), 'defined(scalar @array)';