]> granicus.if.org Git - php/commitdiff
fix tests
authorAntony Dovgal <tony2001@php.net>
Mon, 25 Dec 2006 11:16:05 +0000 (11:16 +0000)
committerAntony Dovgal <tony2001@php.net>
Mon, 25 Dec 2006 11:16:05 +0000 (11:16 +0000)
ext/standard/tests/strings/bug23894.phpt
ext/standard/tests/strings/sprintf_f.phpt
ext/standard/tests/strings/sprintf_f_2.phpt
ext/standard/tests/strings/sprintf_f_3.phpt

index b5ab7b30e0c2d3837f2b2d9e15ac663d4d890c97..0724f945f5a2f77990b3453d0d874e08e6bb2671 100644 (file)
@@ -4,9 +4,9 @@ Bug #23894 (sprintf() decimal specifiers problem)
 <?php
 $a = -12.3456;
 $test = sprintf("%04d", $a);
-var_dump($test, bin2hex($test));
+var_dump($test, bin2hex((binary)$test));
 $test = sprintf("% 13u", $a);
-var_dump($test, bin2hex($test));
+var_dump($test, bin2hex((binary)$test));
 ?>
 --EXPECT--
 string(4) "-012"
@@ -14,7 +14,7 @@ string(8) "2d303132"
 string(13) "   4294967284"
 string(26) "20202034323934393637323834"
 --UEXPECT--
-string(4) "-012"
+unicode(4) "-012"
 unicode(8) "2d303132"
-string(13) "   4294967284"
+unicode(13) "   4294967284"
 unicode(26) "20202034323934393637323834"
index 6cba6d10b4d7fbaf16116790b7e42de2a7816565..cbe851f6a079eb7a282cb0cf9f31b388d3defcbf 100755 (executable)
@@ -38,3 +38,20 @@ string(7) "-005.60"
 string(7) "-5.6000"
 
 string(105) "1234567%d.0000"
+--UEXPECTF--
+unicode(4) "1.20"
+unicode(4) "1.20"
+unicode(4) "1.20"
+unicode(4) "1.20"
+
+unicode(5) " 3.40"
+unicode(5) "3.40 "
+unicode(5) "03.40"
+unicode(5) "3.400"
+
+unicode(7) "  -5.60"
+unicode(7) "-5.60  "
+unicode(7) "-005.60"
+unicode(7) "-5.6000"
+
+unicode(105) "1234567%d.0000"
index c9f84d4f3471206ff2dae813c96135cda7c43dc2..9410cbd22045fc41a506357b524b7f6b018b5a00 100755 (executable)
@@ -79,7 +79,6 @@ $number = 362525200;
 var_dump(sprintf("%.3e", $number)); // outputs 3.63e+8
 ?>
 --EXPECT--
-
 string(7) "100.426"
 string(6) "100.43"
 string(3) "100"
@@ -94,7 +93,7 @@ string(76) "The world contains 100 monkeys.
 string(33) "%b = '10100111101010011010101101'"
 string(8) "%c = 'A'"
 string(15) "%d = '43951789'"
-string(17) "%e = '4.39518e+7'"
+string(18) "%e = '4.395179e+7'"
 string(15) "%u = '43951789'"
 string(17) "%u = '4251015507'"
 string(22) "%f = '43951789.000000'"
@@ -112,4 +111,38 @@ string(12) "[####monkey]"
 string(12) "[many monke]"
 string(10) "2006-12-18"
 string(6) "123.10"
-string(7) "3.63e+8"
+string(8) "3.625e+8"
+--UEXPECT--
+unicode(7) "100.426"
+unicode(6) "100.43"
+unicode(3) "100"
+unicode(3) "100"
+unicode(3) "144"
+unicode(3) "144"
+unicode(34) "There are 100 monkeys in the world"
+unicode(28) "The 100.1 contains 0 monkeys"
+unicode(30) "The world contains 100 monkeys"
+unicode(76) "The world contains 100 monkeys.
+    That's a nice world full of 100 monkeys."
+unicode(33) "%b = '10100111101010011010101101'"
+unicode(8) "%c = 'A'"
+unicode(15) "%d = '43951789'"
+unicode(18) "%e = '4.395179e+7'"
+unicode(15) "%u = '43951789'"
+unicode(17) "%u = '4251015507'"
+unicode(22) "%f = '43951789.000000'"
+unicode(16) "%o = '247523255'"
+unicode(15) "%s = '43951789'"
+unicode(14) "%x = '29ea6ad'"
+unicode(14) "%X = '29EA6AD'"
+unicode(17) "%+d = '+43951789'"
+unicode(17) "%+d = '-43951789'"
+unicode(8) "[monkey]"
+unicode(12) "[    monkey]"
+unicode(12) "[monkey    ]"
+unicode(12) "[0000monkey]"
+unicode(12) "[####monkey]"
+unicode(12) "[many monke]"
+unicode(10) "2006-12-18"
+unicode(6) "123.10"
+unicode(8) "3.625e+8"
index edd12b809493f51d1fde4c7a0c063f220c44ece5..5bcb8b04ddf79b210c00237573645c9678ba4526 100755 (executable)
@@ -22,4 +22,10 @@ string(7) "100,426"
 string(6) "100,43"
 string(11) "100,426000'"
 string(6) "123,10"
-string(7) "1.23e+2"
+string(8) "1.231e+2"
+--UEXPECT--
+unicode(7) "100,426"
+unicode(6) "100,43"
+unicode(11) "100,426000'"
+unicode(6) "123,10"
+unicode(8) "1.231e+2"