From: Sander Roobol Date: Thu, 21 Mar 2002 14:18:30 +0000 (+0000) Subject: Added tests for pow()'ing with broken exponents and some additional test X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~1157 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a15c9a31ebc7041bbe902e3fd0d9947eff4f4b06;p=php Added tests for pow()'ing with broken exponents and some additional test for count()'ing arrays. --- diff --git a/ext/standard/tests/array/count_recursive.phpt b/ext/standard/tests/array/count_recursive.phpt index a6b7ee4afa..1dcd845eaa 100644 --- a/ext/standard/tests/array/count_recursive.phpt +++ b/ext/standard/tests/array/count_recursive.phpt @@ -26,6 +26,12 @@ print "COUNT_RECURSIVE: should be 1, is ".count("string", COUNT_RECURSIVE)."\n"; print "Testing various types with no second argument.\n"; print "COUNT_NORMAL: should be 1, is ".count("string")."\n"; print "COUNT_NORMAL: should be 2, is ".count(array("a", array("b")))."\n"; + +$arr = array('a'=>array(NULL, NULL, NULL), 1=>array(NULL=>1, 1=>NULL), + array(array(array(array(array(NULL)))))); +print "Testing really cool arrays ;)\n"; +print "COUNT_NORMAL: should be 3, is ".count($arr, COUNT_NORMAL)."\n"; +print "COUNT_RECURSIVE: should be 13, is ".count($arr, COUNT_RECURSIVE)."\n"; ?> --EXPECT-- Testing NULL... @@ -42,4 +48,7 @@ COUNT_NORMAL: should be 1, is 1 COUNT_RECURSIVE: should be 1, is 1 Testing various types with no second argument. COUNT_NORMAL: should be 1, is 1 -COUNT_NORMAL: should be 2, is 2 +COUNT_NORMAL: should be 2, is 2 +Testing really cool arrays ;) +COUNT_NORMAL: should be 3, is 3 +COUNT_RECURSIVE: should be 13, is 13 diff --git a/ext/standard/tests/math/pow.phpt b/ext/standard/tests/math/pow.phpt index 3a79a24ef6..12170f4f3a 100644 --- a/ext/standard/tests/math/pow.phpt +++ b/ext/standard/tests/math/pow.phpt @@ -118,6 +118,12 @@ sqrt(2) ~== pow(2,1/2) 1.0 === pow( 2.0, 0) 2.0 === pow( 2.0, 1) 4.0 === pow( 2.0, 2) + 2.0 === pow( 4, 0.5) + 2.0 === pow( 4.0, 0.5) + 3.0 === pow( 27, 1/3) + 3.0 === pow(27.0, 1/3) + 0.5 === pow( 4, -0.5) + 0.5 === pow( 4.0, -0.5) LONG_MAX-1 === pow(LONG_MAX-1,1) LONG_MIN+1 === pow(LONG_MIN+1,1) (LONG_MAX-1)*(LONG_MAX-1) ~== pow(LONG_MAX-1,2)