xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/t/op/reverse.t (revision 0:68f95e015346)
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}
34