JavaScript Tests - update test for bug 410571

This commit is contained in:
bclary@bclary.com 2008-02-11 14:22:02 -08:00
Родитель d63539f050
Коммит 2272a58655
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -41,6 +41,8 @@ var BUGNUMBER = 410571;
var summary = 'incorrect decompilation of last element of object literals'; var summary = 'incorrect decompilation of last element of object literals';
var actual, expect; var actual, expect;
actual = expect = 'PASSED';
printBugNumber(BUGNUMBER); printBugNumber(BUGNUMBER);
printStatus(summary); printStatus(summary);
@ -134,12 +136,12 @@ function checkItems(name, gen)
for (var item in gen) for (var item in gen)
{ {
if (!test.generates[i](item)) if (!test.generates[i](item))
throw "wrong generated value (" + item + ") " + actual = "wrong generated value (" + item + ") " +
"for test " + name + ", item " + i; "for test " + name + ", item " + i;
i++; i++;
} }
if (i !== test.generates.length) if (i !== test.generates.length)
throw "Didn't iterate all of test " + name; actual = "Didn't iterate all of test " + name;
} }
for (var i = 0, sz = tests.length; i < sz; i++) for (var i = 0, sz = tests.length; i < sz; i++)
@ -149,11 +151,9 @@ for (var i = 0, sz = tests.length; i < sz; i++)
var fun = test.fun; var fun = test.fun;
checkItems(i, fun()); checkItems(i, fun());
var dec = fun.toString(); var dec = '(' + fun.toString() + ')';
var rec = eval(dec); var rec = eval(dec);
checkItems("recompiled " + i, rec()); checkItems("recompiled " + i, rec());
} }
expect = actual = "no exception thrown";
reportCompare(expect, actual, summary); reportCompare(expect, actual, summary);