1 This test covers the correctness and behaviour of switch statements.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 PASS characterSwitch('A' + emptyString1) is "A"
7 PASS characterSwitch('A' + emptyString1 + emptyString2) is "A"
8 PASS characterSwitch(emptyString1 + emptyString2) is "default"
9 PASS characterSwitch('\0') is "\0"
10 PASS characterSwitch('A') is "A"
11 PASS characterSwitch('a') is "a"
12 PASS characterSwitch('1') is "1"
13 PASS characterSwitch('-1') is "default"
14 PASS characterSwitch('B') is "B"
15 PASS characterSwitch('') is "default"
16 PASS characterSwitch({toString: function(){return 'B'}}) is "default"
17 PASS characterSwitch(0) is "default"
18 PASS characterSwitch(-0) is "default"
19 PASS characterSwitch(1) is "default"
20 PASS characterSwitch(1.1) is "default"
21 PASS characterSwitch(-1) is "default"
22 PASS characterSwitch(-1000000000) is "default"
23 PASS characterSwitch(1000000000) is "default"
24 PASS characterSwitch({}) is "default"
25 PASS sparseCharacterSwitch('\0') is "\0"
26 PASS sparseCharacterSwitch('A') is "A"
27 PASS sparseCharacterSwitch('a') is "a"
28 PASS sparseCharacterSwitch('1') is "1"
29 PASS sparseCharacterSwitch('-1') is "default"
30 PASS sparseCharacterSwitch('B') is "B"
31 PASS sparseCharacterSwitch('') is ""
32 PASS sparseCharacterSwitch({toString: function(){return 'B'}}) is "default"
33 PASS sparseCharacterSwitch(0) is "default"
34 PASS sparseCharacterSwitch(-0) is "default"
35 PASS sparseCharacterSwitch(1) is "default"
36 PASS sparseCharacterSwitch(1.1) is "default"
37 PASS sparseCharacterSwitch(-1) is "default"
38 PASS sparseCharacterSwitch(-1000000000) is "default"
39 PASS sparseCharacterSwitch(1000000000) is "default"
40 PASS sparseCharacterSwitch({}) is "default"
41 PASS stringSwitch('\0') is "\0"
42 PASS stringSwitch('A') is "A"
43 PASS stringSwitch('a') is "a"
44 PASS stringSwitch('1') is "1"
45 PASS stringSwitch('-1') is "-1"
46 PASS stringSwitch('B') is "B"
47 PASS stringSwitch('') is ""
48 PASS stringSwitch('some string') is "some string"
49 PASS stringSwitch({toString: function(){return 'some string'}}) is "default"
50 PASS stringSwitch('s') is "default"
51 PASS stringSwitch(0) is "default"
52 PASS stringSwitch(-0) is "default"
53 PASS stringSwitch(1) is "default"
54 PASS stringSwitch(1.1) is "default"
55 PASS stringSwitch(-1) is "default"
56 PASS stringSwitch(-1000000000) is "default"
57 PASS stringSwitch(1000000000) is "default"
58 PASS stringSwitch({}) is "default"
59 PASS numberSwitch('\0') is "default"
60 PASS numberSwitch('A') is "default"
61 PASS numberSwitch('a') is "default"
62 PASS numberSwitch('1') is "default"
63 PASS numberSwitch('-1') is "default"
64 PASS numberSwitch('B') is "default"
65 PASS numberSwitch('') is "default"
66 PASS numberSwitch('some string') is "default"
67 PASS numberSwitch({valueOf: function(){return 0}}) is "default"
68 PASS numberSwitch('s') is "default"
69 PASS numberSwitch(0) is 0
70 PASS numberSwitch(-0) is 0
71 PASS numberSwitch(1) is 1
72 PASS numberSwitch(1.1) is "default"
73 PASS numberSwitch(-1) is -1
74 PASS numberSwitch(-1000000000) is "default"
75 PASS numberSwitch(1000000000) is "default"
76 PASS numberSwitch({}) is "default"
77 PASS sparseNumberSwitch('\0') is "default"
78 PASS sparseNumberSwitch('A') is "default"
79 PASS sparseNumberSwitch('a') is "default"
80 PASS sparseNumberSwitch('1') is "default"
81 PASS sparseNumberSwitch('-1') is "default"
82 PASS sparseNumberSwitch('B') is "default"
83 PASS sparseNumberSwitch('') is "default"
84 PASS sparseNumberSwitch('some string') is "default"
85 PASS sparseNumberSwitch({valueOf: function(){return 0}}) is "default"
86 PASS sparseNumberSwitch('s') is "default"
87 PASS sparseNumberSwitch(0) is 0
88 PASS sparseNumberSwitch(-0) is 0
89 PASS sparseNumberSwitch(1) is 1
90 PASS sparseNumberSwitch(1.1) is "default"
91 PASS sparseNumberSwitch(-1) is -1
92 PASS sparseNumberSwitch(-1000000000) is -1000000000
93 PASS sparseNumberSwitch(1000000000) is 1000000000
94 PASS sparseNumberSwitch({}) is "default"
95 PASS generalSwitch('\0') is "\0"
96 PASS generalSwitch('A') is "A"
97 PASS generalSwitch('a') is "a"
98 PASS generalSwitch('1') is "1"
99 PASS generalSwitch('-1') is "-1"
100 PASS generalSwitch('B') is "B"
101 PASS generalSwitch('') is ""
102 PASS generalSwitch('some string') is "some string"
103 PASS generalSwitch({valueOf: function(){return 0}}) is "default"
104 PASS generalSwitch('s') is "default"
105 PASS generalSwitch(0) is 0
106 PASS generalSwitch(-0) is 0
107 PASS generalSwitch(1) is 1
108 PASS generalSwitch(1.1) is "default"
109 PASS generalSwitch(-1) is -1
110 PASS generalSwitch(-1000000000) is -1000000000
111 PASS generalSwitch(1000000000) is 1000000000
112 PASS generalSwitch({}) is "default"
113 PASS successfullyParsed is true