3
require_once ( getenv('MW_INSTALL_PATH') !== false
4
? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc"
5
: dirname( __FILE__ ) . '/../../maintenance/commandLine.inc' );
8
$tests = file( 'exprTests.txt' );
12
// Each test is on one line. The test must always evaluate to '1'.
13
$parser = new ExprParser;
14
foreach( $tests as $test ) {
16
if ( in_string( ';', $test ) )
17
list($input,$expected) = explode(';', $test);
23
$expected = trim($expected);
24
$input = trim($input);
26
$result = $parser->doExpression( $input );
27
if ($result != $expected) {
29
"FAILING test -- $input
30
gave a final result of $result, instead of $expected.\n";
33
print "PASSED test $test\n";
38
print "Passed $pass tests, failed $fail tests, out of a total of ".($pass+$fail)."\n";
b'\\ No newline at end of file'