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 / reverse.t
CommitLineData
3168554e
JH
1#!./perl
2
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6}
7
8print "1..4\n";
9
10print "not " unless reverse("abc") eq "cba";
11print "ok 1\n";
12
13$_ = "foobar";
14print "not " unless reverse() eq "raboof";
15print "ok 2\n";
16
17{
18 my @a = ("foo", "bar");
19 my @b = reverse @a;
20
21 print "not " unless $b[0] eq $a[1] && $b[1] eq $a[0];
22 print "ok 3\n";
23}
24
25{
26 # Unicode.
27
28 my $a = "\x{263A}\x{263A}x\x{263A}y\x{263A}";
29 my $b = scalar reverse($a);
30 my $c = scalar reverse($b);
31 print "not " unless $a eq $c;
32 print "ok 4\n";
33}