Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | var gTestcases = new Array(); |
michael@0 | 2 | var gTc = gTestcases.length; |
michael@0 | 3 | function TestCase(n, d, e, a) { |
michael@0 | 4 | this.passed = getTestCaseResult(e, a); |
michael@0 | 5 | gTestcases[gTc++] = this; |
michael@0 | 6 | } |
michael@0 | 7 | function getTestCaseResult(expected, actual) { |
michael@0 | 8 | if (typeof expected != 'number') |
michael@0 | 9 | return actual == expected; |
michael@0 | 10 | return Math.abs(actual - expected) <= 1E-10; |
michael@0 | 11 | } |
michael@0 | 12 | function test() { |
michael@0 | 13 | for ( gTc=0; gTc < gTestcases.length; gTc++ ) { |
michael@0 | 14 | gTestcases[gTc].passed = writeTestCaseResult(gTestcases[gTc].description +" = "+ gTestcases[gTc].actual); |
michael@0 | 15 | } |
michael@0 | 16 | function writeTestCaseResult( expect, actual, string ) { |
michael@0 | 17 | var passed = getTestCaseResult( expect, actual ); |
michael@0 | 18 | } |
michael@0 | 19 | } |
michael@0 | 20 | var SECTION = "15.4.2.1-1"; |
michael@0 | 21 | new TestCase( SECTION, eval("var arr = (new Array(1,2)); arr[0]") ); |
michael@0 | 22 | new TestCase( SECTION, "var arr = (new Array(1,2)); String(arr)", "1,2", (this.abstract++)); |
michael@0 | 23 | test(); |
michael@0 | 24 | new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 -= VAR2", Number.NaN, eval("VAR1 = Number.NaN; VAR2=1; VAR1 -= VAR2")); |