Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/parseFloat/S15.1.2.3_A4_T6.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: |
6 Compute the longest prefix of Result(2), which might be Result(2) itself,
7 which satisfies the syntax of a StrDecimalLiteral
8 es5id: 15.1.2.3_A4_T6
9 es6id: 18.2.4
10 esid: sec-parsefloat-string
11 description: Checking . DecimalDigits ExponentPart_opt
12 ---*/
13
14 //CHECK#1
15 if (parseFloat("+.1string") !== 0.1) {
16 $ERROR('#1: parseFloat("+.1string") === 0.1. Actual: ' + (parseFloat("+.1string")));
17 }
18
19 //CHECK#2
20 if (parseFloat(".01string") !== 0.01) {
21 $ERROR('#2: parseFloat(".01string") === 0.01. Actual: ' + (parseFloat(".01string")));
22 }
23
24 //CHECK#3
25 if (parseFloat("+.22e-1string") !== 0.022) {
26 $ERROR('#3: parseFloat("+.22e-1string") === 0.022. Actual: ' + (parseFloat("+.22e-1string")));
27 }