diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-12-11 22:37:40 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-12-11 22:37:40 +0000 |
commit | 640283f5813252b086f0011a9256515389d5b6a6 (patch) | |
tree | 3505e3db56ae652508849001ba183367c2b54eb4 /t | |
parent | 57c348a981665d6305f7f38920ab85e57a77ae65 (diff) | |
download | perl-640283f5813252b086f0011a9256515389d5b6a6.tar.gz |
Fix *printf %*vd with mixed Latin 1/UTF-8. (Fixes bug 37889)
p4raw-id: //depot/perl@26325
Diffstat (limited to 't')
-rw-r--r-- | t/uni/sprintf.t | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/t/uni/sprintf.t b/t/uni/sprintf.t index 3c5f574b62..08626498e2 100644 --- a/t/uni/sprintf.t +++ b/t/uni/sprintf.t @@ -6,7 +6,7 @@ BEGIN { require "test.pl"; } -plan tests => 25; +plan tests => 52; $a = "B\x{fc}f"; $b = "G\x{100}r"; @@ -137,3 +137,19 @@ $c = 0x200; $sprintf = sprintf "%s%s", $w, "$w\x{100}"; is(substr($sprintf,0,2), $w, "utf8 echo echo"); } + +my @values =(chr 110, chr 255, chr 256); + +foreach my $prefix (@values) { + foreach my $vector (map {$_ . $_} @values) { + + my $format = "$prefix%*vd"; + + foreach my $dot (@values) { + my $result = sprintf $format, $dot, $vector; + is (length $result, 8) + or print "# ", join (',', map {ord $_} $prefix, $dot, $vector), + "\n"; + } + } +} |