This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Test case for C<undef %File::Glob::>
[perl5.git] / t / op / wantarray.t
CommitLineData
1d0ef875
NA
1#!./perl
2
d6483035 3print "1..7\n";
1d0ef875
NA
4sub context {
5 my ( $cona, $testnum ) = @_;
6 my $conb = (defined wantarray) ? ( wantarray ? 'A' : 'S' ) : 'V';
7 unless ( $cona eq $conb ) {
8 print "# Context $conb should be $cona\nnot ";
9 }
10 print "ok $testnum\n";
11}
12
13context('V',1);
14$a = context('S',2);
15@a = context('A',3);
d6483035
GS
16scalar context('S',4);
17$a = scalar context('S',5);
18($a) = context('A',6);
19($a) = scalar context('S',7);
1d0ef875 201;