summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-12-11 22:37:40 +0000
committerNicholas Clark <nick@ccl4.org>2005-12-11 22:37:40 +0000
commit640283f5813252b086f0011a9256515389d5b6a6 (patch)
tree3505e3db56ae652508849001ba183367c2b54eb4 /t
parent57c348a981665d6305f7f38920ab85e57a77ae65 (diff)
downloadperl-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.t18
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";
+ }
+ }
+}