зеркало из https://github.com/mozilla/shumway.git
Fix NaN === NaN tester
This commit is contained in:
Родитель
1b5a0233f7
Коммит
170cd7a413
|
@ -87,7 +87,7 @@ describe('AVM1 Interpreter (Tamarin acceptance tests)', function() {
|
|||
if (results.failed) {
|
||||
var testCases = results.testCases;
|
||||
for (var q = 0; q < testCases.length; q++) {
|
||||
if (testCases[q].expect === testCases[q].actual) continue;
|
||||
if (!testCases[q].failed) continue;
|
||||
reason += '#' + q + ' | ' + testCases[q].description + ' | ' +
|
||||
testCases[q].reason + ' | ' + testCases[q].expect + ' != ' +
|
||||
testCases[q].actual + ' / ';
|
||||
|
|
|
@ -4,12 +4,14 @@ class TestCase {
|
|||
var reason;
|
||||
var expect;
|
||||
var actual;
|
||||
var failed;
|
||||
function TestCase(sectionName, description, expect, actual) {
|
||||
this.sectionName = sectionName;
|
||||
this.description = description;
|
||||
this.reason = '';
|
||||
this.expect = expect;
|
||||
this.actual = actual;
|
||||
this.failed = true;
|
||||
}
|
||||
|
||||
static function startTest() { }
|
||||
|
@ -17,7 +19,8 @@ class TestCase {
|
|||
var atLeastOneFailed = false;
|
||||
for (var i = 0; i < testCases.length; i++) {
|
||||
var tc = testCases[i];
|
||||
var failed = tc.expect !== tc.actual;
|
||||
var failed = !(tc.expect === tc.actual || (isNaN(tc.expect) && isNaN(tc.actual)));
|
||||
tc.failed = failed;
|
||||
log('Test case #' + i + ' | ' + tc.expect +
|
||||
(failed ? ' != ' : ' == ') + tc.actual +
|
||||
' | ' + tc.sectionName + ' | ' + tc.reason);
|
||||
|
|
Загрузка…
Ссылка в новой задаче