diff options
Diffstat (limited to 'extensions/ParserFunctions/testExpr.php')
-rw-r--r-- | extensions/ParserFunctions/testExpr.php | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/extensions/ParserFunctions/testExpr.php b/extensions/ParserFunctions/testExpr.php deleted file mode 100644 index b3336c53..00000000 --- a/extensions/ParserFunctions/testExpr.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -require_once ( getenv( 'MW_INSTALL_PATH' ) !== false - ? getenv( 'MW_INSTALL_PATH' ) . "/maintenance/commandLine.inc" - : dirname( __FILE__ ) . '/../../maintenance/commandLine.inc' ); -require( 'Expr.php' ); - -$tests = file( 'exprTests.txt' ); - -$pass = $fail = 0; - -// Each test is on one line. The test must always evaluate to '1'. -$parser = new ExprParser; -foreach ( $tests as $test ) { - $test = trim( $test ); - if ( strpos( $test, ';' ) !== false ) - list( $input, $expected ) = explode( ';', $test ); - else { - $input = $test; - $expected = 1; - } - - $expected = trim( $expected ); - $input = trim( $input ); - - $result = $parser->doExpression( $input ); - if ( $result != $expected ) { - print - "FAILING test -- $input - gave a final result of $result, instead of $expected.\n"; - $fail++; - } else { - print "PASSED test $test\n"; - $pass++; - } -} - -print "Passed $pass tests, failed $fail tests, out of a total of " . ( $pass + $fail ) . "\n";
\ No newline at end of file |