Fix bug #16080 : an attribute list should end at '}'
[p5sagit/p5-mst-13.2.git] / t / op / dor.t
CommitLineData
c963b151 1#!./perl
2
3# Test // and friends.
4
5BEGIN {
6 chdir 't' if -d 't';
7 @INC = '../lib';
8}
9
10package main;
11require './test.pl';
12
13plan( tests => 9 );
14
15my($x);
16
17$x=1;
18is($x // 0, 1, ' // : left-hand operand defined');
19
20$x = undef;
21is($x // 1, 1, ' // : left-hand operand undef');
22
23$x='';
24is($x // 0, '', ' // : left-hand operand defined but empty');
25
26$x=1;
27is(($x err 0), 1, ' err: left-hand operand defined');
28
29$x = undef;
30is(($x err 1), 1, ' err: left-hand operand undef');
31
32$x='';
33is(($x err 0), '', ' err: left-hand operand defined but empty');
34
35$x=undef;
36$x //= 1;
37is($x, 1, ' //=: left-hand operand undefined');
38
39$x //= 0;
40is($x, 1, ' //=: left-hand operand defined');
41
42$x = '';
43$x //= 0;
44is($x, '', ' //=: left-hand operand defined but empty');