forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstringtypespec.js
More file actions
46 lines (43 loc) · 2.8 KB
/
stringtypespec.js
File metadata and controls
46 lines (43 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
function test(s1, s2, s3, s4, s5, s6, s7, s8) {
if (s1 == s2) { WScript.Echo("fail"); } else { WScript.Echo("pass"); }
if (s1 === s2) { WScript.Echo("fail"); } else { WScript.Echo("pass"); }
if (s1 != s2) { WScript.Echo("pass"); } else { WScript.Echo("fail"); }
if (s1 !== s2) { WScript.Echo("pass"); } else { WScript.Echo("fail"); }
if (s1 == s3) { WScript.Echo("pass"); } else { WScript.Echo("fail"); }
if (s1 === s3) { WScript.Echo("pass"); } else { WScript.Echo("fail"); }
if (s1 != s3) { WScript.Echo("fail"); } else { WScript.Echo("pass"); }
if (s1 !== s3) { WScript.Echo("fail"); } else { WScript.Echo("pass"); }
if (s1.charAt(0) == s4) { WScript.Echo("pass"); } else { WScript.Echo("fail"); }
if (s1.charAt(0) === s4) { WScript.Echo("pass"); } else { WScript.Echo("fail"); }
if (s1.charAt(0) != s4) { WScript.Echo("fail"); } else { WScript.Echo("pass"); }
if (s1.charAt(0) !== s4) { WScript.Echo("fail"); } else { WScript.Echo("pass"); }
if (s1.charAt(0) == s5) { WScript.Echo("fail"); } else { WScript.Echo("pass"); }
if (s1.charAt(0) === s5) { WScript.Echo("fail"); } else { WScript.Echo("pass"); }
if (s1.charAt(0) != s5) { WScript.Echo("pass"); } else { WScript.Echo("fail"); }
if (s1.charAt(0) !== s5) { WScript.Echo("pass"); } else { WScript.Echo("fail"); }
if (s1 == s6) { WScript.Echo("fail"); } else { WScript.Echo("pass"); }
if (s1 === s6) { WScript.Echo("fail"); } else { WScript.Echo("pass"); }
if (s1 != s6) { WScript.Echo("pass"); } else { WScript.Echo("fail"); }
if (s1 !== s6) { WScript.Echo("pass"); } else { WScript.Echo("fail"); }
if (s7 == s1) { WScript.Echo("fail"); } else { WScript.Echo("pass"); }
if (s7 === s1) { WScript.Echo("fail"); } else { WScript.Echo("pass"); }
if (s7 != s1) { WScript.Echo("pass"); } else { WScript.Echo("fail"); }
if (s7 !== s1) { WScript.Echo("pass"); } else { WScript.Echo("fail"); }
if (s7 == s8) { WScript.Echo("pass"); } else { WScript.Echo("fail"); }
if (s7 === s8) { WScript.Echo("pass"); } else { WScript.Echo("fail"); }
if (s7 != s8) { WScript.Echo("fail"); } else { WScript.Echo("pass"); }
if (s7 !== s8) { WScript.Echo("fail"); } else { WScript.Echo("pass"); }
}
var s1 = "This is a string";
var s2 = "This is another string";
var s3 = "This is a string";
var s4 = "T";
var s5 = "X";
var s6 = { };
var s7 = s1.slice(-1,0);
var s8 = "";
test(s1, s2, s3, s4, s5, s6, s7, s8);