jscript: Added this expression implementation.
[wine.git] / dlls / jscript / tests / lang.js
blob4c26c2fd30e9a3a78a166ceddf25b6cfbfea3249
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 ok(typeof(0) === "number", "typeof(0) is not number");
60 ok(typeof(1.5) === "number", "typeof(1.5) is not number");
61 ok(typeof("abc") === "string", "typeof(\"abc\") is not string");
62 ok(typeof("") === "string", "typeof(\"\") is not string");
63 ok(typeof(true) === "boolean", "typeof(true) is not boolean");
64 ok(typeof(null) === "object", "typeof(null) is not object");
65 ok(typeof(undefined) === "undefined", "typeof(undefined) is not undefined");
66 ok(typeof(Math) === "object", "typeof(Math) is not object");
67 ok(typeof(String.prototype) === "object", "typeof(String.prototype) is not object");
68 ok(typeof(testFunc1) === "function", "typeof(testFunc1) is not function");
69 ok(typeof(String) === "function", "typeof(String) is not function");
70 ok(typeof(ScriptEngine) === "function", "typeof(ScriptEngine) is not function");
71 ok(typeof(this) === "object", "typeof(this) is not object");
73 reportSuccess();