OLD | NEW |
1 Tests for .valueAsNumber with <input type=number>. | 1 Tests for .valueAsNumber with <input type=number>. |
2 | 2 |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". |
4 | 4 |
5 | 5 |
6 PASS valueAsNumberFor("0") is 0 | 6 PASS valueAsNumberFor("0") is 0 |
7 PASS valueAsNumberFor("0.2") is 0.2 | 7 PASS valueAsNumberFor("0.2") is 0.2 |
8 PASS valueAsNumberFor(".2") is 0.2 | 8 PASS valueAsNumberFor(".2") is 0.2 |
9 PASS valueAsNumberFor("10") is 10 | 9 PASS valueAsNumberFor("10") is 10 |
10 PASS valueAsNumberFor("01") is 1 | 10 PASS valueAsNumberFor("01") is 1 |
11 PASS valueAsNumberFor("-0") is 0 | 11 PASS valueAsNumberFor("-0") is 0 |
12 PASS valueAsNumberFor("-1.2") is -1.2 | 12 PASS valueAsNumberFor("-1.2") is -1.2 |
13 PASS valueAsNumberFor("1.2E10") is 1.2E10 | 13 PASS valueAsNumberFor("1.2E10") is 1.2E10 |
14 PASS valueAsNumberFor("1.2E-10") is 1.2E-10 | 14 PASS valueAsNumberFor("1.2E-10") is 1.2E-10 |
15 PASS valueAsNumberFor("1.2E+10") is 1.2E10 | 15 PASS valueAsNumberFor("1.2E+10") is 1.2E10 |
16 PASS valueAsNumberFor("123456789012345678901234567890123456789") is 1.2345678901
234568E+38 | 16 PASS valueAsNumberFor("123456789012345678901234567890123456789012345678901234567
89012345678901234567890123456789012345678901234567890123456789012345678901234567
89012345678901234567890123456789012345678901234567890123456789012345678901234567
89012345678901234567890123456789012345678901234567890123456789012345678901234567
890123456789") is 1.2345678901234568E+308 |
17 PASS valueAsNumberFor("0.12345678901234567890123456789012345678901234567890") is
0.123456789012345678 | 17 PASS valueAsNumberFor("0.12345678901234567890123456789012345678901234567890") is
0.123456789012345678 |
18 valueAsNumber for invalid string values: | 18 valueAsNumber for invalid string values: |
19 PASS isNaN(valueAsNumberFor("")) is true | 19 PASS isNaN(valueAsNumberFor("")) is true |
20 PASS isNaN(valueAsNumberFor("abc")) is true | 20 PASS isNaN(valueAsNumberFor("abc")) is true |
21 PASS isNaN(valueAsNumberFor("0xff")) is true | 21 PASS isNaN(valueAsNumberFor("0xff")) is true |
22 PASS isNaN(valueAsNumberFor("+1")) is true | 22 PASS isNaN(valueAsNumberFor("+1")) is true |
23 PASS isNaN(valueAsNumberFor(" 10")) is true | 23 PASS isNaN(valueAsNumberFor(" 10")) is true |
24 PASS isNaN(valueAsNumberFor("10 ")) is true | 24 PASS isNaN(valueAsNumberFor("10 ")) is true |
25 PASS isNaN(valueAsNumberFor(".")) is true | 25 PASS isNaN(valueAsNumberFor(".")) is true |
26 PASS isNaN(valueAsNumberFor("1E")) is true | 26 PASS isNaN(valueAsNumberFor("1E")) is true |
27 PASS isNaN(valueAsNumberFor("NaN")) is true | 27 PASS isNaN(valueAsNumberFor("NaN")) is true |
28 PASS isNaN(valueAsNumberFor("nan")) is true | 28 PASS isNaN(valueAsNumberFor("nan")) is true |
29 PASS isNaN(valueAsNumberFor("Inf")) is true | 29 PASS isNaN(valueAsNumberFor("Inf")) is true |
30 PASS isNaN(valueAsNumberFor("inf")) is true | 30 PASS isNaN(valueAsNumberFor("inf")) is true |
31 PASS isNaN(valueAsNumberFor("Infinity")) is true | 31 PASS isNaN(valueAsNumberFor("Infinity")) is true |
32 PASS isNaN(valueAsNumberFor("infinity")) is true | 32 PASS isNaN(valueAsNumberFor("infinity")) is true |
33 Too huge exponent to support | 33 Too huge exponent to support |
34 PASS isNaN(valueAsNumberFor("1.2E65535")) is true | 34 PASS isNaN(valueAsNumberFor("1.2E65535")) is true |
35 Tests for the valueAsNumber setter: | 35 Tests for the valueAsNumber setter: |
36 PASS setValueAsNumberAndGetValue(0) is "0" | 36 PASS setValueAsNumberAndGetValue(0) is "0" |
37 PASS setValueAsNumberAndGetValue(10) is "10" | 37 PASS setValueAsNumberAndGetValue(10) is "10" |
38 PASS setValueAsNumberAndGetValue(01) is "1" | 38 PASS setValueAsNumberAndGetValue(01) is "1" |
39 PASS setValueAsNumberAndGetValue(-0) is "0" | 39 PASS setValueAsNumberAndGetValue(-0) is "0" |
40 PASS setValueAsNumberAndGetValue(-1.2) is "-1.2" | 40 PASS setValueAsNumberAndGetValue(-1.2) is "-1.2" |
41 PASS setValueAsNumberAndGetValue(1.2e10) is "12000000000" | 41 PASS setValueAsNumberAndGetValue(1.2e10) is "12000000000" |
42 PASS setValueAsNumberAndGetValue(1.2e-10) is "1.2e-10" | 42 PASS setValueAsNumberAndGetValue(1.2e-10) is "1.2e-10" |
43 PASS setValueAsNumberAndGetValue(1.2345678901234567e+38) is "1.2345678901234567e
+38" | 43 PASS setValueAsNumberAndGetValue(1.2345678901234567e+308) is "1.2345678901234567
e+308" |
44 PASS setValueAsNumberAndGetValue("-3.40282346e+38") is "-3.40282346e+38" | 44 PASS setValueAsNumberAndGetValue("-1.797693134862315e+308") is "-1.7976931348623
15e+308" |
45 PASS setValueAsNumberAndGetValue("-3.40282348e+38") threw exception InvalidState
Error: Failed to set the 'valueAsNumber' property on 'HTMLInputElement': The val
ue provided (-3.40282e+38) is outside the range (-3.40282e+38, 3.40282e+38).. | 45 PASS setValueAsNumberAndGetValue("-1.797693134862316e+308") threw exception Type
Error: Failed to set the 'valueAsNumber' property on 'HTMLInputElement': The val
ue provided is infinite.. |
46 PASS setValueAsNumberAndGetValue("3.40282346e+38") is "3.40282346e+38" | 46 PASS setValueAsNumberAndGetValue("1.797693134862315e+308") is "1.797693134862315
e+308" |
47 PASS setValueAsNumberAndGetValue("3.40282348e+38") threw exception InvalidStateE
rror: Failed to set the 'valueAsNumber' property on 'HTMLInputElement': The valu
e provided (3.40282e+38) is outside the range (-3.40282e+38, 3.40282e+38).. | 47 PASS setValueAsNumberAndGetValue("1.797693134862316e+308") threw exception TypeE
rror: Failed to set the 'valueAsNumber' property on 'HTMLInputElement': The valu
e provided is infinite.. |
48 Tests to set invalid values to valueAsNumber: | 48 Tests to set invalid values to valueAsNumber: |
49 PASS setValueAsNumberAndGetValue(null) is "0" | 49 PASS setValueAsNumberAndGetValue(null) is "0" |
50 PASS setValueAsNumberAndGetValue("foo") is "" | 50 PASS setValueAsNumberAndGetValue("foo") is "" |
51 PASS setValueAsNumberAndGetValue(NaN) is "" | 51 PASS setValueAsNumberAndGetValue(NaN) is "" |
52 PASS setValueAsNumberAndGetValue(Number.NaN) is "" | 52 PASS setValueAsNumberAndGetValue(Number.NaN) is "" |
53 PASS setValueAsNumberAndGetValue(Infinity) threw exception TypeError: Failed to
set the 'valueAsNumber' property on 'HTMLInputElement': The value provided is in
finite.. | 53 PASS setValueAsNumberAndGetValue(Infinity) threw exception TypeError: Failed to
set the 'valueAsNumber' property on 'HTMLInputElement': The value provided is in
finite.. |
54 PASS setValueAsNumberAndGetValue(Number.POSITIVE_INFINITY) threw exception TypeE
rror: Failed to set the 'valueAsNumber' property on 'HTMLInputElement': The valu
e provided is infinite.. | 54 PASS setValueAsNumberAndGetValue(Number.POSITIVE_INFINITY) threw exception TypeE
rror: Failed to set the 'valueAsNumber' property on 'HTMLInputElement': The valu
e provided is infinite.. |
55 PASS setValueAsNumberAndGetValue(Number.NEGATIVE_INFINITY) threw exception TypeE
rror: Failed to set the 'valueAsNumber' property on 'HTMLInputElement': The valu
e provided is infinite.. | 55 PASS setValueAsNumberAndGetValue(Number.NEGATIVE_INFINITY) threw exception TypeE
rror: Failed to set the 'valueAsNumber' property on 'HTMLInputElement': The valu
e provided is infinite.. |
56 PASS successfullyParsed is true | 56 PASS successfullyParsed is true |
57 | 57 |
58 TEST COMPLETE | 58 TEST COMPLETE |
59 | 59 |
OLD | NEW |