Commit | Line | Data |
8d063cd8 |
1 | #!./perl |
2 | |
88587957 |
3 | chdir 't' if -d 't'; |
4 | |
4e3399f9 |
5 | print "1..15\n"; |
8d063cd8 |
6 | |
7 | @a = (1,2,3,4,5,6,7,8,9,10,11,12); |
8 | |
c6aa4a32 |
9 | while ($_ = shift(@a)) { |
8d063cd8 |
10 | if ($x = /4/../8/) { $z = $x; print "ok ", $x + 0, "\n"; } |
11 | $y .= /1/../2/; |
12 | } |
13 | |
14 | if ($z eq '5E0') {print "ok 6\n";} else {print "not ok 6\n";} |
15 | |
16 | if ($y eq '12E0123E0') {print "ok 7\n";} else {print "not ok 7\n";} |
17 | |
18 | @a = ('a','b','c','d','e','f','g'); |
19 | |
4e3399f9 |
20 | { |
21 | local $.; |
22 | |
2eb25c99 |
23 | open(of,'harness') or die "Can't open harness: $!"; |
8d063cd8 |
24 | while (<of>) { |
a0d0e21e |
25 | (3 .. 5) && ($foo .= $_); |
8d063cd8 |
26 | } |
27 | $x = ($foo =~ y/\n/\n/); |
28 | |
29 | if ($x eq 3) {print "ok 8\n";} else {print "not ok 8 $x:$foo:\n";} |
3e3baf6d |
30 | |
31 | $x = 3.14; |
32 | if (($x...$x) eq "1") {print "ok 9\n";} else {print "not ok 9\n";} |
790090df |
33 | |
34 | { |
35 | # coredump reported in bug 20001018.008 |
36 | readline(UNKNOWN); |
37 | $. = 1; |
4e3399f9 |
38 | $x = 1..10; |
39 | print "ok 10\n"; |
40 | } |
41 | |
790090df |
42 | } |
4e3399f9 |
43 | |
44 | if (!defined $.) { print "ok 11\n" } else { print "not ok 11 # $.\n" } |
45 | |
46 | use warnings; |
47 | my $warn=''; |
48 | $SIG{__WARN__} = sub { $warn .= join '', @_ }; |
49 | |
50 | if (0..2) { print "ok 12\n" } else { print "not ok 12\n" } |
51 | |
52 | if ($warn =~ /uninitialized/) { print "ok 13\n" } else { print "not ok 13\n" } |
53 | $warn = ''; |
54 | |
55 | $x = "foo".."bar"; |
56 | |
57 | if ((() = ($warn =~ /isn't numeric/g)) == 2) { |
58 | print "ok 14\n" |
59 | } |
60 | else { |
61 | print "not ok 14\n" |
62 | } |
63 | $warn = ''; |
64 | |
65 | $. = 15; |
66 | if (15..0) { print "ok 15\n" } else { print "not ok 15\n" } |