X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=tests%2Fskip.inc;h=d8770fb1fda6f405e690ddd3ab22f489a6352c06;hp=63ae05cff423c3f4f13a78d403a6a18d92966f4a;hb=d7ce6cca59bb57636f075048fc3ff48038c3e45e;hpb=976c6c8c58c93c4ab74e9c23e1cf5b31b2b1bd78 diff --git a/tests/skip.inc b/tests/skip.inc index 63ae05c..d8770fb 100644 --- a/tests/skip.inc +++ b/tests/skip.inc @@ -6,8 +6,8 @@ if (!function_exists('fprintf')) { function skipif($if, $skip) { if ($if) { fprintf(STDOUT, "skip $skip"); exit(); }} function checkcgi() { skipif(!strncasecmp('CLI', PHP_SAPI, 3), 'need CGI SAPI'); } function checkext($ext) { skipif(!extension_loaded($ext), "need ext/$ext"); } -function checkmin($ver) { skipif(round($ver,1) > round((double) PHP_VERSION,1), sprintf("need PHP >= v%0.1f",$ver)); } -function checkmax($ver) { skipif(round($ver,1) < round((double) PHP_VERSION,1), sprintf("need PHP <= v%0.1f",$ver)); } +function checkmin($ver) { skipif(version_compare(PHP_VERSION, $ver) < 0, sprintf("need PHP >= v%s",$ver)); } +function checkmax($ver) { skipif(version_compare(PHP_VERSION, $ver) > 0, sprintf("need PHP <= v%s",$ver)); } function checkurl($url) { skipif(!@fsockopen($url, 80), "$url not responsive"); } function checkcls($cls) { skipif(!class_exists($cls), "need class $cls"); } function checkver($ver) { checkmin($ver); }