1 # Copyright 2013 the V8 project authors. All rights reserved. 2 # Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 # 4 # Redistribution and use in source and binary forms, with or without 5 # modification, are permitted provided that the following conditions 6 # are met: 7 # 1. Redistributions of source code must retain the above copyright 8 # notice, this list of conditions and the following disclaimer. 9 # 2. Redistributions in binary form must reproduce the above copyright 10 # notice, this list of conditions and the following disclaimer in the 11 # documentation and/or other materials provided with the distribution. 12 # 13 # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY 14 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 # DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY 17 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 20 # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 24 KDE JS Test 25 26 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 27 28 29 PASS !undefined is true 30 PASS !null is true 31 PASS !!true is true 32 PASS !false is true 33 PASS !!1 is true 34 PASS !0 is true 35 PASS !!'a' is true 36 PASS !'' is true 37 PASS nonSpeculativeNot(undefined) is true 38 PASS nonSpeculativeNot(null) is true 39 PASS nonSpeculativeNot(!true) is true 40 PASS nonSpeculativeNot(false) is true 41 PASS nonSpeculativeNot(!1) is true 42 PASS nonSpeculativeNot(0) is true 43 PASS nonSpeculativeNot(!'a') is true 44 PASS nonSpeculativeNot('') is true 45 PASS +9 is 9 46 PASS var i = 10; +i is 10 47 PASS -11 is -11 48 PASS var i = 12; -i is -12 49 PASS var i = 0; ++i; is 1 50 PASS var i = 0; ++i; i is 1 51 PASS var i = 0; i++; is 0 52 PASS var i = 0; i++; i is 1 53 PASS var i = true; i++ is 1 54 PASS var i = true; i++; i is 2 55 PASS var i = 0; --i; is -1 56 PASS var i = 0; --i; i is -1 57 PASS var i = 0; i--; is 0 58 PASS var i = 0; i--; i is -1 59 PASS var i = true; i-- is 1 60 PASS var i = true; i--; i is 0 61 PASS ~0 is -1 62 PASS ~1 is -2 63 PASS ~NaN is -1 64 PASS ~Infinity is -1 65 PASS ~Math.pow(2, 33) is -1 66 PASS ~(Math.pow(2, 32) + Math.pow(2, 31) + 2) is 2147483645 67 PASS ~null is -1 68 PASS 3 & 1 is 1 69 PASS 2 | true is 3 70 PASS '3' ^ 1 is 2 71 PASS 3^4&5 is 7 72 PASS 2|4^5 is 3 73 PASS 1 << 2 is 4 74 PASS 8 >> 1 is 4 75 PASS 1 >> 2 is 0 76 PASS -8 >> 24 is -1 77 PASS 8 >>> 2 is 2 78 PASS -8 >>> 24 is 255 79 PASS (-2200000000 >> 1) << 1 is 2094967296 80 PASS Infinity >> 1 is 0 81 PASS Infinity << 1 is 0 82 PASS Infinity >>> 1 is 0 83 PASS NaN >> 1 is 0 84 PASS NaN << 1 is 0 85 PASS NaN >>> 1 is 0 86 PASS 8.1 >> 1 is 4 87 PASS 8.1 << 1 is 16 88 PASS 8.1 >>> 1 is 4 89 PASS 8.9 >> 1 is 4 90 PASS 8.9 << 1 is 16 91 PASS 8.9 >>> 1 is 4 92 PASS Math.pow(2, 32) >> 1 is 0 93 PASS Math.pow(2, 32) << 1 is 0 94 PASS Math.pow(2, 32) >>> 1 is 0 95 PASS 1 << two is 4 96 PASS 8 >> one is 4 97 PASS 1 >> two is 0 98 PASS -8 >> twentyFour is -1 99 PASS 8 >>> two is 2 100 PASS -8 >>> twentyFour is 255 101 PASS (-2200000000 >> one) << one is 2094967296 102 PASS Infinity >> one is 0 103 PASS Infinity << one is 0 104 PASS Infinity >>> one is 0 105 PASS NaN >> one is 0 106 PASS NaN << one is 0 107 PASS NaN >>> one is 0 108 PASS 888.1 >> one is 444 109 PASS 888.1 << one is 1776 110 PASS 888.1 >>> one is 444 111 PASS 888.9 >> one is 444 112 PASS 888.9 << one is 1776 113 PASS 888.9 >>> one is 444 114 PASS Math.pow(2, 32) >> one is 0 115 PASS Math.pow(2, 32) << one is 0 116 PASS Math.pow(2, 32) >>> one is 0 117 PASS 1+2 is 3 118 PASS 'a'+'b' is 'ab' 119 PASS 'a'+2 is 'a2' 120 PASS '2'+'-1' is '2-1' 121 PASS true+'a' is 'truea' 122 PASS 'a' + null is 'anull' 123 PASS true+1 is 2 124 PASS false+null is 0 125 PASS 1-3 is -2 126 PASS isNaN('a'-3) is true 127 PASS '3'-'-1' is 4 128 PASS '4'-2 is 2 129 PASS true-false is 1 130 PASS false-1 is -1 131 PASS null-true is -1 132 PASS 2 * 3 is 6 133 PASS true * 3 is 3 134 PASS 2 * '3' is 6 135 PASS 6 / 4 is 1.5 136 PASS '6' / '2' is 3 137 PASS isNaN('x' / 1) is true 138 PASS isNaN(1 / NaN) is true 139 PASS isNaN(Infinity / Infinity) is true 140 PASS Infinity / 0 is Infinity 141 PASS -Infinity / 0 is -Infinity 142 PASS Infinity / 1 is Infinity 143 PASS -Infinity / 1 is -Infinity 144 PASS 1 / Infinity == +0 is true 145 PASS 1 / -Infinity == -0 is true 146 PASS isNaN(0/0) is true 147 PASS 0 / 1 === 0 is true 148 PASS 0 / -1 === -0 is true 149 PASS 1 / 0 is Infinity 150 PASS -1 / 0 is -Infinity 151 PASS 6 % 4 is 2 152 PASS '-6' % 4 is -2 153 PASS 2==2 is true 154 PASS 1==2 is false 155 PASS nonSpeculativeEqual(2,2) is true 156 PASS nonSpeculativeEqual(1,2) is false 157 PASS 1<2 is true 158 PASS 1<=2 is true 159 PASS 2<1 is false 160 PASS 2<=1 is false 161 PASS nonSpeculativeLess(1,2) is true 162 PASS nonSpeculativeLessEq(1,2) is true 163 PASS nonSpeculativeLess(2,1) is false 164 PASS nonSpeculativeLessEq(2,1) is false 165 PASS 2>1 is true 166 PASS 2>=1 is true 167 PASS 1>=2 is false 168 PASS 1>2 is false 169 PASS nonSpeculativeGreater(2,1) is true 170 PASS nonSpeculativeGreaterEq(2,1) is true 171 PASS nonSpeculativeGreaterEq(1,2) is false 172 PASS nonSpeculativeGreater(1,2) is false 173 PASS 'abc' == 'abc' is true 174 PASS 'abc' != 'xyz' is true 175 PASS true == true is true 176 PASS false == false is true 177 PASS true != false is true 178 PASS 'a' != null is true 179 PASS 'a' != undefined is true 180 PASS null == null is true 181 PASS null == undefined is true 182 PASS undefined == undefined is true 183 PASS NaN != NaN is true 184 PASS true != undefined is true 185 PASS true != null is true 186 PASS false != undefined is true 187 PASS false != null is true 188 PASS '0' == 0 is true 189 PASS 1 == '1' is true 190 PASS NaN != NaN is true 191 PASS NaN != 0 is true 192 PASS NaN != undefined is true 193 PASS true == 1 is true 194 PASS true != 2 is true 195 PASS 1 == true is true 196 PASS false == 0 is true 197 PASS 0 == false is true 198 PASS nonSpeculativeEqual('abc', 'abc') is true 199 PASS nonSpeculativeNotEqual('abc', 'xyz') is true 200 PASS nonSpeculativeEqual(true, true) is true 201 PASS nonSpeculativeEqual(false, false) is true 202 PASS nonSpeculativeNotEqual(true, false) is true 203 PASS nonSpeculativeNotEqual('a', null) is true 204 PASS nonSpeculativeNotEqual('a', undefined) is true 205 PASS nonSpeculativeEqual(null, null) is true 206 PASS nonSpeculativeEqual(null, undefined) is true 207 PASS nonSpeculativeEqual(undefined, undefined) is true 208 PASS nonSpeculativeNotEqual(NaN, NaN) is true 209 PASS nonSpeculativeNotEqual(true, undefined) is true 210 PASS nonSpeculativeNotEqual(true, null) is true 211 PASS nonSpeculativeNotEqual(false, undefined) is true 212 PASS nonSpeculativeNotEqual(false, null) is true 213 PASS nonSpeculativeEqual('0', 0) is true 214 PASS nonSpeculativeEqual(1, '1') is true 215 PASS nonSpeculativeNotEqual(NaN, NaN) is true 216 PASS nonSpeculativeNotEqual(NaN, 0) is true 217 PASS nonSpeculativeNotEqual(NaN, undefined) is true 218 PASS nonSpeculativeEqual(true, 1) is true 219 PASS nonSpeculativeNotEqual(true, 2) is true 220 PASS nonSpeculativeEqual(1, true) is true 221 PASS nonSpeculativeEqual(false, 0) is true 222 PASS nonSpeculativeEqual(0, false) is true 223 PASS 'abc' < 'abx' is true 224 PASS 'abc' < 'abcd' is true 225 PASS 'abc' < 'abc' is false 226 PASS 'abcd' < 'abcd' is false 227 PASS 'abx' < 'abc' is false 228 PASS nonSpeculativeLess('abc', 'abx') is true 229 PASS nonSpeculativeLess('abc', 'abcd') is true 230 PASS nonSpeculativeLess('abc', 'abc') is false 231 PASS nonSpeculativeLess('abcd', 'abcd') is false 232 PASS nonSpeculativeLess('abx', 'abc') is false 233 PASS 'abc' <= 'abc' is true 234 PASS 'abc' <= 'abx' is true 235 PASS 'abx' <= 'abc' is false 236 PASS 'abcd' <= 'abc' is false 237 PASS 'abc' <= 'abcd' is true 238 PASS nonSpeculativeLessEq('abc', 'abc') is true 239 PASS nonSpeculativeLessEq('abc', 'abx') is true 240 PASS nonSpeculativeLessEq('abx', 'abc') is false 241 PASS nonSpeculativeLessEq('abcd', 'abc') is false 242 PASS nonSpeculativeLessEq('abc', 'abcd') is true 243 PASS 'abc' > 'abx' is false 244 PASS 'abc' > 'abc' is false 245 PASS 'abcd' > 'abc' is true 246 PASS 'abx' > 'abc' is true 247 PASS 'abc' > 'abcd' is false 248 PASS nonSpeculativeGreater('abc', 'abx') is false 249 PASS nonSpeculativeGreater('abc', 'abc') is false 250 PASS nonSpeculativeGreater('abcd', 'abc') is true 251 PASS nonSpeculativeGreater('abx', 'abc') is true 252 PASS nonSpeculativeGreater('abc', 'abcd') is false 253 PASS 'abc' >= 'abc' is true 254 PASS 'abcd' >= 'abc' is true 255 PASS 'abx' >= 'abc' is true 256 PASS 'abc' >= 'abx' is false 257 PASS 'abc' >= 'abx' is false 258 PASS 'abc' >= 'abcd' is false 259 PASS nonSpeculativeGreaterEq('abc', 'abc') is true 260 PASS nonSpeculativeGreaterEq('abcd', 'abc') is true 261 PASS nonSpeculativeGreaterEq('abx', 'abc') is true 262 PASS nonSpeculativeGreaterEq('abc', 'abx') is false 263 PASS nonSpeculativeGreaterEq('abc', 'abx') is false 264 PASS nonSpeculativeGreaterEq('abc', 'abcd') is false 265 PASS 'abc' <= 0 is false 266 PASS '' <= 0 is true 267 PASS ' ' <= 0 is true 268 PASS null <= 0 is true 269 PASS 0 <= 'abc' is false 270 PASS 0 <= '' is true 271 PASS 0 <= null is true 272 PASS null <= null is true 273 PASS 6 < '52' is true 274 PASS 6 < '72' is true 275 PASS NaN < 0 is false 276 PASS NaN <= 0 is false 277 PASS NaN > 0 is false 278 PASS NaN >= 0 is false 279 PASS nonSpeculativeLessEq('abc', 0) is false 280 PASS nonSpeculativeLessEq('', 0) is true 281 PASS nonSpeculativeLessEq(' ', 0) is true 282 PASS nonSpeculativeLessEq(null, 0) is true 283 PASS nonSpeculativeLessEq(0, 'abc') is false 284 PASS nonSpeculativeLessEq(0, '') is true 285 PASS nonSpeculativeLessEq(0, null) is true 286 PASS nonSpeculativeLessEq(null, null) is true 287 PASS nonSpeculativeLess(6, '52') is true 288 PASS nonSpeculativeLess(6, '72') is true 289 PASS nonSpeculativeLess(NaN, 0) is false 290 PASS nonSpeculativeLessEq(NaN, 0) is false 291 PASS nonSpeculativeGreater(NaN, 0) is false 292 PASS nonSpeculativeGreaterEq(NaN, 0) is false 293 PASS 0 === false is false 294 PASS null === null is true 295 PASS NaN === NaN is false 296 PASS 0.0 === 0 is true 297 PASS 'abc' === 'abc' is true 298 PASS 'a' === 'x' is false 299 PASS 1 === '1' is false 300 PASS '1' === 1 is false 301 PASS true === true is true 302 PASS false === false is true 303 PASS true === false is false 304 PASS Math === Math is true 305 PASS Math === Boolean is false 306 PASS Infinity === Infinity is true 307 PASS nonSpeculativeStrictEqual(0, false) is false 308 PASS nonSpeculativeStrictEqual(null, null) is true 309 PASS nonSpeculativeStrictEqual(NaN, NaN) is false 310 PASS nonSpeculativeStrictEqual(0.0, 0) is true 311 PASS nonSpeculativeStrictEqual('abc', 'abc') is true 312 PASS nonSpeculativeStrictEqual('a', 'x') is false 313 PASS nonSpeculativeStrictEqual(1, '1') is false 314 PASS nonSpeculativeStrictEqual('1', 1) is false 315 PASS nonSpeculativeStrictEqual(true, true) is true 316 PASS nonSpeculativeStrictEqual(false, false) is true 317 PASS nonSpeculativeStrictEqual(true, false) is false 318 PASS nonSpeculativeStrictEqual(Math, Math) is true 319 PASS nonSpeculativeStrictEqual(Math, Boolean) is false 320 PASS nonSpeculativeStrictEqual(Infinity, Infinity) is true 321 PASS 0 !== 0 is false 322 PASS 0 !== 1 is true 323 PASS nonSpeculativeStrictNotEqual(0, 0) is false 324 PASS nonSpeculativeStrictNotEqual(0, 1) is true 325 PASS typeof undefined is 'undefined' 326 PASS typeof null is 'object' 327 PASS typeof true is 'boolean' 328 PASS typeof false is 'boolean' 329 PASS typeof 1 is 'number' 330 PASS typeof 'a' is 'string' 331 PASS typeof shouldBe is 'function' 332 PASS typeof Number.NaN is 'number' 333 PASS 11 && 22 is 22 334 PASS null && true is null 335 PASS 11 || 22 is 11 336 PASS null || 'a' is 'a' 337 PASS void 1 is undefined. 338 PASS 1 in [1, 2] is true 339 PASS 3 in [1, 2] is false 340 PASS 'a' in { a:1, b:2 } is true 341 PASS (new Boolean()) instanceof Boolean is true 342 PASS (new Boolean()) instanceof Number is false 343 PASS successfullyParsed is true 344 345 TEST COMPLETE 346 347