From 2b08f5a5c074094f4269ae0646d4c75bc7e0c625 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Mon, 25 Feb 2013 16:56:15 -0800 Subject: [PATCH] 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 --- tests/engines/LuaCommon/LuaInterpreterTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/engines/LuaCommon/LuaInterpreterTest.php b/tests/engines/LuaCommon/LuaInterpreterTest.php index 4a532ba4..3ae742fc 100644 --- a/tests/engines/LuaCommon/LuaInterpreterTest.php +++ b/tests/engines/LuaCommon/LuaInterpreterTest.php @@ -69,14 +69,14 @@ abstract class Scribunto_LuaInterpreterTest extends MediaWikiTestCase { $passthru = $interpreter->loadString( 'return ...', 'passthru' ); $ret = $interpreter->callFunction( $passthru, NAN ); - $this->assertEquals( array( NAN ), $ret ); + $this->assertTrue( is_nan( $ret[0] ), 'NaN was not passed through' ); $interpreter->registerLibrary( 'test', array( 'passthru' => array( $this, 'passthru' ) ) ); $doublePassthru = $interpreter->loadString( 'return test.passthru(...)', 'doublePassthru' ); $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 ) {