This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Check that sparse files hold at least a block (bug in eCryptfs: https://bugs.launchpa...
[perl5.git] / t / op / flip.t
1 #!./perl
2
3 chdir 't' if -d 't';
4
5 print "1..15\n";
6
7 @a = (1,2,3,4,5,6,7,8,9,10,11,12);
8
9 while ($_ = shift(@a)) {
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
20 {
21 local $.;
22
23 open(of,'harness') or die "Can't open harness: $!";
24 while (<of>) {
25     (3 .. 5) && ($foo .= $_);
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";}
30
31 $x = 3.14;
32 if (($x...$x) eq "1") {print "ok 9\n";} else {print "not ok 9\n";}
33
34 {
35     # coredump reported in bug 20001018.008
36     readline(UNKNOWN);
37     $. = 1;
38     $x = 1..10;
39     print "ok 10\n";
40 }
41
42 }
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" }