jscript: Added Math object stub implementation.
[wine/hacks.git] / dlls / jscript / tests / lang.js
blob96ecdb496e38129ed2222b2cc6844ecf8f9d25e1
1 /*
2  * Copyright 2008 Jacek Caban for CodeWeavers
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
19 ok(true, "true is not true?");
20 ok(!false, "!false is not true");
21 ok(!undefined, "!undefined is not true");
22 ok(!null, "!null is not true");
23 ok(!0, "!0 is not true");
24 ok(!0.0, "!0.0 is not true");
26 ok(1 === 1, "1 === 1 is false");
27 ok(!(1 === 2), "!(1 === 2) is false");
28 ok(1.0 === 1, "1.0 === 1 is false");
29 ok("abc" === "abc", "\"abc\" === \"abc\" is false");
30 ok(true === true, "true === true is false");
31 ok(null === null, "null === null is false");
32 ok(undefined === undefined, "undefined === undefined is false");
33 ok(!(undefined === null), "!(undefined === null) is false");
35 ok(1 !== 2, "1 !== 2 is false");
36 ok(null !== undefined, "null !== undefined is false");
38 var trueVar = true;
39 ok(trueVar, "trueVar is not true");
41 ok(ScriptEngine.length === 0, "ScriptEngine.length is not 0");
43 function testFunc1(x, y) {
44     return true;
47 ok(testFunc1.length === 2, "testFunc1.length is not 2");
49 ok(Object.prototype !== undefined, "Object.prototype is undefined");
50 ok(Object.prototype.prototype === undefined, "Object.prototype is not undefined");
51 ok(String.prototype !== undefined, "String.prototype is undefined");
52 ok(Array.prototype !== undefined, "Array.prototype is undefined");
53 ok(Boolean.prototype !== undefined, "Boolean.prototype is undefined");
54 ok(Number.prototype !== undefined, "Number.prototype is undefined");
55 ok(RegExp.prototype !== undefined, "RegExp.prototype is undefined");
56 ok(Math !== undefined, "Math is undefined");
57 ok(Math.prototype === undefined, "Math.prototype is not undefined");
59 reportSuccess();