summaryrefslogtreecommitdiff
path: root/t/uni
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-02-20 21:43:21 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-02-20 21:43:21 +0000
commite486a898ae6f84b70e35d58345c832b5915d9e9f (patch)
tree3c4c825bc3d445ca2401410e607fcec46d30e73a /t/uni
parenteb5603165ab61a683806a34f59885b99cd506b12 (diff)
downloadperl-e486a898ae6f84b70e35d58345c832b5915d9e9f.tar.gz
Better debugging info.
p4raw-id: //depot/perl@14799
Diffstat (limited to 't/uni')
-rw-r--r--t/uni/case.pl22
1 files changed, 14 insertions, 8 deletions
diff --git a/t/uni/case.pl b/t/uni/case.pl
index f5c4f7888a..f982b1d64f 100644
--- a/t/uni/case.pl
+++ b/t/uni/case.pl
@@ -2,6 +2,10 @@ use File::Spec;
require "test.pl";
+sub unidump {
+ join " ", map { sprintf "%04X", $_ } unpack "U*", $_[0];
+}
+
sub casetest {
my ($base, $spec, $func) = @_;
my $file = File::Spec->catfile(File::Spec->catdir(File::Spec->updir,
@@ -49,30 +53,32 @@ sub casetest {
my $test = 1;
for my $i (sort { hex $a <=> hex $b } keys %simple) {
- my $w = "$i -> $simple{$i}";
+ my $w = $simple{$i};
my $c = pack "U0U", hex $i;
my $d = $func->($c);
+ my $e = unidump($d);
print $d eq pack("U0U", hex $simple{$i}) ?
- "ok $test # $w\n" : "not ok $test # $w\n";
+ "ok $test # $i -> $w\n" : "not ok $test # $i -> $e ($w)\n";
$test++;
}
for my $i (sort { hex $a <=> hex $b } keys %$spec) {
- my $w = qq[$i -> "] . display($spec->{$i}) . qq["];
+ my $w = unidump($spec->{$i});
my $c = pack "U0U", hex $i;
my $d = $func->($c);
+ my $e = unidump($d);
print $d eq $spec->{$i} ?
- "ok $test # $w\n" : "not ok $test # $w\n";
+ "ok $test # $i -> $w\n" : "not ok $test # $i -> $e ($w)\n";
$test++;
}
-
for my $i (sort { $a <=> $b } keys %none) {
- my $w = sprintf "%04X -> %04X", $i, $i;
- my $c = pack "U0U", $i;
+ my $w = $i = sprintf "%04X", $i;
+ my $c = pack "U0U", hex $i;
my $d = $func->($c);
+ my $e = unidump($d);
print $d eq $c ?
- "ok $test # $w\n" : "not ok $test # $w\n";
+ "ok $test # $i -> $w\n" : "not ok $test # $i -> $e ($w)\n";
$test++;
}
}