From: Ævar Arnfjörð Bjarmason Date: Tue, 3 Jan 2006 05:25:29 +0000 (+0000) Subject: * New unit test directory X-Git-Tag: 1.6.0~794 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=8fc4ba8630da65e93b170aab7f7e13eea2d692a9;p=lhc%2Fweb%2Fwiklou.git * New unit test directory --- diff --git a/maintenance/tests/ctype.php b/maintenance/tests/ctype.php new file mode 100644 index 0000000000..df7cf36b76 --- /dev/null +++ b/maintenance/tests/ctype.php @@ -0,0 +1,33 @@ +$~', '', $cont ); + +eval( $cont ); + +foreach ( $m[1] as $function ) { + $php = "$function"; + $mw = "_$function"; + $range = range( -1000, 1000 ); + foreach ( $range as $i ) { + ret_cmp( $php, $i, $php( $i ), $mw( $i ) ); + } + + foreach ( $range as $i ) { + $i = chr( $i ); + ret_cmp( $php, $i, $php( $i ), $mw( $i ) ); + } + + ret_cmp( $php, $i, $php( array() ), $mw( array() ) ); +} + +function ret_cmp( $fname, $in, $php, $mw ) { + if ( $php != '' ) + return; + if ( $php !== $mw ) + echo "PHP $fname() returned '" . serialize( $php ) . "' for '" . serialize( $in) . "', MediaWiki returned '" . serialize( $mw ) . "'\n"; +} +?>