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
24This is a test of the charAt and charCodeAt string functions.
25
26On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
27
28
29PASS "".charAt() is ""
30PASS "".charCodeAt() is NaN
31PASS "".charAt(undefined) is ""
32PASS "".charCodeAt(undefined) is NaN
33PASS "".charAt(0) is ""
34PASS "".charCodeAt(0) is NaN
35PASS "".charAt(null) is ""
36PASS "".charCodeAt(null) is NaN
37PASS "".charAt(false) is ""
38PASS "".charCodeAt(false) is NaN
39PASS "".charAt(true) is ""
40PASS "".charCodeAt(true) is NaN
41PASS "".charAt(0) is ""
42PASS "".charCodeAt(0) is NaN
43PASS "".charAt(0.1) is ""
44PASS "".charCodeAt(0.1) is NaN
45PASS "".charAt(999) is ""
46PASS "".charCodeAt(999) is NaN
47PASS "".charAt(Infinity) is ""
48PASS "".charCodeAt(Infinity) is NaN
49PASS "".charAt(-1) is ""
50PASS "".charCodeAt(-1) is NaN
51PASS "".charAt(-Infinity) is ""
52PASS "".charCodeAt(-Infinity) is NaN
53PASS "".charAt(NaN) is ""
54PASS "".charCodeAt(NaN) is NaN
55PASS "x".charAt() is "x"
56PASS "x".charCodeAt() is 120
57PASS "x".charAt(undefined) is "x"
58PASS "x".charCodeAt(undefined) is 120
59PASS "x".charAt(0) is "x"
60PASS "x".charCodeAt(0) is 120
61PASS "x".charAt(null) is "x"
62PASS "x".charCodeAt(null) is 120
63PASS "x".charAt(false) is "x"
64PASS "x".charCodeAt(false) is 120
65PASS "x".charAt(true) is ""
66PASS "x".charCodeAt(true) is NaN
67PASS "x".charAt(0) is "x"
68PASS "x".charCodeAt(0) is 120
69PASS "x".charAt(0.1) is "x"
70PASS "x".charCodeAt(0.1) is 120
71PASS "x".charAt(999) is ""
72PASS "x".charCodeAt(999) is NaN
73PASS "x".charAt(Infinity) is ""
74PASS "x".charCodeAt(Infinity) is NaN
75PASS "x".charAt(-1) is ""
76PASS "x".charCodeAt(-1) is NaN
77PASS "x".charAt(-Infinity) is ""
78PASS "x".charCodeAt(-Infinity) is NaN
79PASS "x".charAt(NaN) is "x"
80PASS "x".charCodeAt(NaN) is 120
81PASS "xy".charAt() is "x"
82PASS "xy".charCodeAt() is 120
83PASS "xy".charAt(undefined) is "x"
84PASS "xy".charCodeAt(undefined) is 120
85PASS "xy".charAt(0) is "x"
86PASS "xy".charCodeAt(0) is 120
87PASS "xy".charAt(null) is "x"
88PASS "xy".charCodeAt(null) is 120
89PASS "xy".charAt(false) is "x"
90PASS "xy".charCodeAt(false) is 120
91PASS "xy".charAt(true) is "y"
92PASS "xy".charCodeAt(true) is 121
93PASS "xy".charAt(0) is "x"
94PASS "xy".charCodeAt(0) is 120
95PASS "xy".charAt(0.1) is "x"
96PASS "xy".charCodeAt(0.1) is 120
97PASS "xy".charAt(999) is ""
98PASS "xy".charCodeAt(999) is NaN
99PASS "xy".charAt(Infinity) is ""
100PASS "xy".charCodeAt(Infinity) is NaN
101PASS "xy".charAt(-1) is ""
102PASS "xy".charCodeAt(-1) is NaN
103PASS "xy".charAt(-Infinity) is ""
104PASS "xy".charCodeAt(-Infinity) is NaN
105PASS "xy".charAt(NaN) is "x"
106PASS "xy".charCodeAt(NaN) is 120
107PASS successfullyParsed is true
108
109TEST COMPLETE
110
111