This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Port t/op/reverse.t to test.pl
[perl5.git]
/
t
/
op
/
reverse.t
1
#!./perl
2
3
BEGIN {
4
chdir 't' if -d 't';
5
@INC = '../lib';
6
require './test.pl';
7
}
8
9
plan tests => 5;
10
11
is(reverse("abc"), "cba");
12
13
$_ = "foobar";
14
is(reverse(), "raboof");
15
16
{
17
my @a = ("foo", "bar");
18
my @b = reverse @a;
19
20
is($b[0], $a[1]);
21
is($b[1], $a[0]);
22
}
23
24
{
25
# Unicode.
26
27
my $a = "\x{263A}\x{263A}x\x{263A}y\x{263A}";
28
my $b = scalar reverse($a);
29
my $c = scalar reverse($b);
30
is($a, $c);
31
}