• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
24Tests for the parseFloat function.
25
26On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
27
28
29PASS parseFloat() is NaN
30PASS parseFloat('') is NaN
31PASS parseFloat(' ') is NaN
32PASS parseFloat(' 0') is 0
33PASS parseFloat('0 ') is 0
34PASS parseFloat('x0') is NaN
35PASS parseFloat('0x') is 0
36PASS parseFloat(' 1') is 1
37PASS parseFloat('1 ') is 1
38PASS parseFloat('x1') is NaN
39PASS parseFloat('1x') is 1
40PASS parseFloat(' 2.3') is 2.3
41PASS parseFloat('2.3 ') is 2.3
42PASS parseFloat('x2.3') is NaN
43PASS parseFloat('2.3x') is 2.3
44PASS parseFloat('0x2') is 0
45PASS parseFloat('1' + nonASCIINonSpaceCharacter) is 1
46PASS parseFloat(nonASCIINonSpaceCharacter + '1') is NaN
47PASS parseFloat('1' + illegalUTF16Sequence) is 1
48PASS parseFloat(illegalUTF16Sequence + '1') is NaN
49PASS parseFloat(tab + '1') is 1
50PASS parseFloat(nbsp + '1') is 1
51PASS parseFloat(ff + '1') is 1
52PASS parseFloat(vt + '1') is 1
53PASS parseFloat(cr + '1') is 1
54PASS parseFloat(lf + '1') is 1
55PASS parseFloat(ls + '1') is 1
56PASS parseFloat(ps + '1') is 1
57PASS parseFloat(oghamSpaceMark + '1') is 1
58PASS parseFloat(mongolianVowelSeparator + '1') is 1
59PASS parseFloat(enQuad + '1') is 1
60PASS parseFloat(emQuad + '1') is 1
61PASS parseFloat(enSpace + '1') is 1
62PASS parseFloat(emSpace + '1') is 1
63PASS parseFloat(threePerEmSpace + '1') is 1
64PASS parseFloat(fourPerEmSpace + '1') is 1
65PASS parseFloat(sixPerEmSpace + '1') is 1
66PASS parseFloat(figureSpace + '1') is 1
67PASS parseFloat(punctuationSpace + '1') is 1
68PASS parseFloat(thinSpace + '1') is 1
69PASS parseFloat(hairSpace + '1') is 1
70PASS parseFloat(narrowNoBreakSpace + '1') is 1
71PASS parseFloat(mediumMathematicalSpace + '1') is 1
72PASS parseFloat(ideographicSpace + '1') is 1
73PASS successfullyParsed is true
74
75TEST COMPLETE
76
77