Fix NaN unit test in phpunit 3.7.14

In phpunit 3.6.10, assertEquals considered two NaNs to be equivalent.
Somewhere between that and phpunit 3.7.14, this behavior changed so NaNs
are no longer considered equivalent.

Change-Id: I2c664498eb34cf5119a2eaaa96a6be57b821ab94
This commit is contained in:
Brad Jorsch 2013-02-25 16:56:15 -08:00
parent bf689b7758
commit 2b08f5a5c0

View file

@ -69,14 +69,14 @@ abstract class Scribunto_LuaInterpreterTest extends MediaWikiTestCase {
$passthru = $interpreter->loadString( 'return ...', 'passthru' ); $passthru = $interpreter->loadString( 'return ...', 'passthru' );
$ret = $interpreter->callFunction( $passthru, NAN ); $ret = $interpreter->callFunction( $passthru, NAN );
$this->assertEquals( array( NAN ), $ret ); $this->assertTrue( is_nan( $ret[0] ), 'NaN was not passed through' );
$interpreter->registerLibrary( 'test', $interpreter->registerLibrary( 'test',
array( 'passthru' => array( $this, 'passthru' ) ) ); array( 'passthru' => array( $this, 'passthru' ) ) );
$doublePassthru = $interpreter->loadString( $doublePassthru = $interpreter->loadString(
'return test.passthru(...)', 'doublePassthru' ); 'return test.passthru(...)', 'doublePassthru' );
$ret = $interpreter->callFunction( $doublePassthru, NAN ); $ret = $interpreter->callFunction( $doublePassthru, NAN );
$this->assertEquals( array( NAN ), $ret ); $this->assertTrue( is_nan( $ret[0] ), 'NaN was not double passed through' );
} }
function normalizeOrder( $a ) { function normalizeOrder( $a ) {