use Char;
# -*- coding: iso885913 -*-

print "1..8\n";

if (Char::ord('A') == CORE::ord('A')) {
    print qq{ok - 1 Char::ord\n};
}
else {
    print qq{not ok - 1 Char::ord\n};
}

my @reverse = Char::reverse('123','456','789','0');
if (join(',',@reverse) eq '0,789,456,123') {
    print qq{ok - 2 wantarray Char::reverse\n};
}
else {
    print qq{not ok - 2 wantarray Char::reverse\n};
}

my $reverse = Char::reverse('123','456','789','0');
if ($reverse eq '0987654321') {
    print qq{ok - 3 scalar Char::reverse\n};
}
else {
    print qq{not ok - 3 scalar Char::reverse\n};
}

open(FILE,'>a.txt');
print FILE 'A';
close(FILE);
if (open(FILE,'a.txt')) {
    if ((my $c = Char::getc(FILE)) eq 'A') {
        print qq{ok - 4 Char::getc (got $c)\n};
    }
    else {
        print qq{not ok - 4 Char::getc (got $c)\n};
    }
    close(FILE);
}
else {
    print qq{not ok - 4 Char::getc can't open file.\n};
}
unlink('a.txt');

if (Char::length('1234567890') == 10) {
    print qq{ok - 5 Char::length\n};
}
else {
    print qq{not ok - 5 Char::length\n};
}

if (Char::substr('1234567890',2,3) eq '345') {
    print qq{ok - 6 Char::substr\n};
}
else {
    print qq{not ok - 6 Char::substr\n};
}

if (Char::index('1234567890','456') == 3) {
    print qq{ok - 7 Char::index\n};
}
else {
    print qq{not ok - 7 Char::index\n};
}

if (Char::rindex('1234567890','678') == 5) {
    print qq{ok - 8 Char::rindex\n};
}
else {
    print qq{not ok - 8 Char::rindex\n};
}

__END__
