This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8cache.t: Skip only the XS-dependent test
[perl5.git] / t / op / flip.t
CommitLineData
8d063cd8
LW
1#!./perl
2
5376f8ad
GG
3BEGIN {
4 require "test.pl";
5}
88587957 6
5376f8ad 7plan(11);
8d063cd8
LW
8
9@a = (1,2,3,4,5,6,7,8,9,10,11,12);
5376f8ad 10@b = ();
c6aa4a32 11while ($_ = shift(@a)) {
5376f8ad 12 if ($x = /4/../8/) { $z = $x; push @b, $x + 0; }
8d063cd8
LW
13 $y .= /1/../2/;
14}
5376f8ad 15is(join("*", @b), "1*2*3*4*5");
8d063cd8 16
5376f8ad 17is($z, '5E0');
8d063cd8 18
5376f8ad 19is($y, '12E0123E0');
8d063cd8
LW
20
21@a = ('a','b','c','d','e','f','g');
22
4e3399f9
YST
23{
24local $.;
25
2eb25c99 26open(of,'harness') or die "Can't open harness: $!";
8d063cd8 27while (<of>) {
a0d0e21e 28 (3 .. 5) && ($foo .= $_);
8d063cd8
LW
29}
30$x = ($foo =~ y/\n/\n/);
31
5376f8ad 32is($x, 3);
3e3baf6d
TB
33
34$x = 3.14;
5376f8ad 35ok(($x...$x) eq "1");
790090df
HS
36
37{
38 # coredump reported in bug 20001018.008
39 readline(UNKNOWN);
40 $. = 1;
4e3399f9 41 $x = 1..10;
5376f8ad 42 ok(1);
4e3399f9
YST
43}
44
790090df 45}
4e3399f9 46
5376f8ad 47ok(!defined $.);
4e3399f9
YST
48
49use warnings;
50my $warn='';
51$SIG{__WARN__} = sub { $warn .= join '', @_ };
52
5376f8ad 53ok(scalar(0..2));
4e3399f9 54
5376f8ad 55like($warn, qr/uninitialized/);
4e3399f9
YST
56$warn = '';
57
58$x = "foo".."bar";
59
5376f8ad 60ok((() = ($warn =~ /isn't numeric/g)) == 2);
4e3399f9
YST
61$warn = '';
62
63$. = 15;
5376f8ad 64ok(scalar(15..0));