No bug: Add testcases, r=tests

This commit is contained in:
Hannes Verschore 2013-06-24 17:50:59 +02:00
parent ccfd1c8cb1
commit 4c52191bf3
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,12 @@
// |jit-test| error: InternalError: too much recursion
function TestCase(d) {
toPrinted(d)
}
function toPrinted(value) {}
function reportCompare (expected, actual, description) {
if (typeof description == "undefined")
toPrinted(expected);
new TestCase(description);
reportCompare();
}
reportCompare(Math['LN2'], Math['LN2'], 0);

View File

@ -0,0 +1,20 @@
function TestCase( e, a) {
getTestCaseResult(e, a);
}
function getTestCaseResult(expected, actual) {}
var msPerSecond = 1000;
var TIME_0000 = (function () { })();
var now = new Date();
var TIME_NOW = now.valueOf();
function msFromTime(t) {
var ms = t % msPerSecond;
return ((ms < 0) ? msPerSecond + ms : ms );
}
new TestCase(false, eval("true, false"));
addTestCase( TIME_NOW );
addTestCase( TIME_0000 );
function addTestCase( t ) {
for ( m = 0; m <= 1000; m+=100 ) {
new TestCase(msFromTime(t), (new Date(t)).getMilliseconds());
}
}