From 3a4b89661e4b68b3de8ae337a82684bcfeb7dc48 Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Sat, 20 Feb 2021 10:55:02 +0000 Subject: Remove quicktester This is barely used and more of a hinderence than anything else Closes GH-6712 --- tests/lang/bug24054.phpt | 14 ++++----- tests/quicktester.inc | 74 ------------------------------------------------ 2 files changed, 5 insertions(+), 83 deletions(-) delete mode 100644 tests/quicktester.inc (limited to 'tests') diff --git a/tests/lang/bug24054.phpt b/tests/lang/bug24054.phpt index aa098fc524..0b90ee3aff 100644 --- a/tests/lang/bug24054.phpt +++ b/tests/lang/bug24054.phpt @@ -8,17 +8,13 @@ define('LONG_MIN', -LONG_MAX - 1); printf("%d,%d,%d,%d\n",is_int(LONG_MIN ),is_int(LONG_MAX ), is_int(LONG_MIN-1),is_int(LONG_MAX+1)); - $i = LONG_MAX; +$i = LONG_MAX; +$j = $i * 1001; +$i *= 1001; - $j = $i * 1001; - $i *= 1001; +var_dump($i === $j); -$tests = << --EXPECT-- 1,1,0,0 -OK +bool(true) diff --git a/tests/quicktester.inc b/tests/quicktester.inc deleted file mode 100644 index ba243beba0..0000000000 --- a/tests/quicktester.inc +++ /dev/null @@ -1,74 +0,0 @@ -$test) -{ - // ignore empty lines - if (!$test) continue; - - // warn for trailing ; - if (substr(trim($test), -1, 1) === ';') { - echo "WARNING: trailing ';' found in test ".($n+1)."\n"; - exit; - } - - // try for operators - $operators = array('===', '~=='); - $operator = NULL; - foreach ($operators as $a_operator) { - if (strpos($test, $a_operator)!== FALSE) { - $operator = $a_operator; - list($left,$right) = explode($operator, $test); - break; - } - } - if (!$operator) { - echo "WARNING: unknown operator in '$test' (1)\n"; - exit; - } - - $left = eval("return ($left );"); - $right = eval("return ($right);"); - switch (@$operator) { - case '===': // exact match - $result = $left === $right; - break; - case '~==': // may differ after 12th significant number - if ( !is_float($left ) && !is_int($left ) - || !is_float($right) && !is_int($right)) { - $result = FALSE; - break; - } - $result = abs(($left-$right) / $left) < 1e-12; - break; - default: - echo "WARNING: unknown operator in '$test' (2)\n"; - exit; - } - - $success = $success && $result; - if (!$result) { - echo "\nAssert failed:\n"; - echo "$test\n"; - echo "Left: ";var_dump($left ); - echo "Right: ";var_dump($right); - } -} -if ($success) echo "OK"; -- cgit v1.2.1