blob: d7b7d1998079a2f47f1d50c4f3c4ee5c1f79c4c0 [file] [log] [blame]
Check stepping-up and -down for range input from renderer.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Function arguments are (min, max, step, value, [stepCount]).
Using the default values
PASS stepUpExplicitBounds(null, null, null, "") is "51"
PASS stepDownExplicitBounds(null, null, null, "") is "49"
PASS stepUpExplicitBounds(null, null, "any", "") is "51"
PASS stepDownExplicitBounds(null, null, "any", "") is "49"
PASS stepUpExplicitBounds(null, null, "foo", "") is "51"
PASS stepDownExplicitBounds(null, null, "foo", "") is "49"
PASS stepUpExplicitBounds(null, null, null, "foo") is "51"
PASS stepDownExplicitBounds(null, null, null, "foo") is "49"
PASS stepUpExplicitBounds(null, null, "any", "foo") is "51"
PASS stepDownExplicitBounds(null, null, "any", "foo") is "49"
PASS stepUpExplicitBounds(null, null, "foo", "foo") is "51"
PASS stepDownExplicitBounds(null, null, "foo", "foo") is "49"
Normal cases
PASS stepUpExplicitBounds(null, null, null, "0") is "1"
PASS stepUpExplicitBounds(null, null, null, "1", 2) is "3"
PASS stepUpExplicitBounds(null, null, null, "3", -1) is "2"
PASS stepDownExplicitBounds("-100", null, null, "2") is "1"
PASS stepDownExplicitBounds("-100", null, null, "1", 2) is "-1"
PASS stepDownExplicitBounds("-100", null, null, "-1", -1) is "0"
Fractional cases
PASS stepUpExplicitBounds(-10, 10, 1, "0.1") is "1"
PASS stepUpExplicitBounds(-10, 10, 1, "0.2") is "1"
PASS stepUpExplicitBounds(-10, 10, 1, "1.0") is "2"
PASS stepUpExplicitBounds(-10, 10, 1, "1.1") is "2"
PASS stepUpExplicitBounds(-10, 10, 1, "1.2") is "2"
PASS stepUpExplicitBounds(-10, 10, 1, "2.0") is "3"
PASS stepUpExplicitBounds(-10, 10, 1, "-0.1") is "1"
PASS stepUpExplicitBounds(-10, 10, 1, "-0.2") is "1"
PASS stepUpExplicitBounds(-10, 10, 1, "-1.0") is "0"
PASS stepUpExplicitBounds(-10, 10, 1, "-1.1") is "0"
PASS stepUpExplicitBounds(-10, 10, 1, "-1.2") is "0"
PASS stepUpExplicitBounds(-10, 10, 1, "-2.0") is "-1"
PASS stepDownExplicitBounds(-10, 10, 1, "0.1") is "-1"
PASS stepDownExplicitBounds(-10, 10, 1, "0.2") is "-1"
PASS stepDownExplicitBounds(-10, 10, 1, "1.0") is "0"
PASS stepDownExplicitBounds(-10, 10, 1, "1.1") is "0"
PASS stepDownExplicitBounds(-10, 10, 1, "1.2") is "0"
PASS stepDownExplicitBounds(-10, 10, 1, "2.0") is "1"
PASS stepDownExplicitBounds(-10, 10, 1, "-0.1") is "-1"
PASS stepDownExplicitBounds(-10, 10, 1, "-0.2") is "-1"
PASS stepDownExplicitBounds(-10, 10, 1, "-1.0") is "-2"
PASS stepDownExplicitBounds(-10, 10, 1, "-1.1") is "-2"
PASS stepDownExplicitBounds(-10, 10, 1, "-1.2") is "-2"
PASS stepDownExplicitBounds(-10, 10, 1, "-2.0") is "-3"
PASS stepUpExplicitBounds(-10, 10, 1, ".1") is "1"
PASS stepUpExplicitBounds(-10, 10, 1, ".2") is "1"
PASS stepUpExplicitBounds(-10, 10, 1, "1.") is "2"
PASS stepUpExplicitBounds(-10, 10, 1, "2.") is "3"
PASS stepUpExplicitBounds(-10, 10, 1, "-.1") is "1"
PASS stepUpExplicitBounds(-10, 10, 1, "-.2") is "1"
PASS stepUpExplicitBounds(-10, 10, 1, "-1.") is "0"
PASS stepUpExplicitBounds(-10, 10, 1, "-2.") is "-1"
PASS stepDownExplicitBounds(-10, 10, 1, ".1") is "-1"
PASS stepDownExplicitBounds(-10, 10, 1, ".2") is "-1"
PASS stepDownExplicitBounds(-10, 10, 1, "1.") is "0"
PASS stepDownExplicitBounds(-10, 10, 1, "2.") is "1"
PASS stepDownExplicitBounds(-10, 10, 1, "-.1") is "-1"
PASS stepDownExplicitBounds(-10, 10, 1, "-.2") is "-1"
PASS stepDownExplicitBounds(-10, 10, 1, "-1.") is "-2"
PASS stepDownExplicitBounds(-10, 10, 1, "-2.") is "-3"
PASS stepUpExplicitBounds(-10, 10, .1, "0.1") is "0.2"
PASS stepUpExplicitBounds(-10, 10, .1, "0.2") is "0.3"
PASS stepUpExplicitBounds(-10, 10, .1, "1.0") is "1.1"
PASS stepUpExplicitBounds(-10, 10, .1, "1.1") is "1.2"
PASS stepUpExplicitBounds(-10, 10, .1, "1.2") is "1.3"
PASS stepUpExplicitBounds(-10, 10, .1, "2.0") is "2.1"
PASS stepUpExplicitBounds(-10, 10, .1, "-0.1") is "0"
PASS stepUpExplicitBounds(-10, 10, .1, "-0.2") is "-0.1"
PASS stepUpExplicitBounds(-10, 10, .1, "-1.0") is "-0.9"
PASS stepUpExplicitBounds(-10, 10, .1, "-1.1") is "-1"
PASS stepUpExplicitBounds(-10, 10, .1, "-1.2") is "-1.1"
PASS stepUpExplicitBounds(-10, 10, .1, "-2.0") is "-1.9"
PASS stepDownExplicitBounds(-10, 10, .1, "0.1") is "0"
PASS stepDownExplicitBounds(-10, 10, .1, "0.2") is "0.1"
PASS stepDownExplicitBounds(-10, 10, .1, "1.0") is "0.9"
PASS stepDownExplicitBounds(-10, 10, .1, "1.1") is "1"
PASS stepDownExplicitBounds(-10, 10, .1, "1.2") is "1.1"
PASS stepDownExplicitBounds(-10, 10, .1, "2.0") is "1.9"
PASS stepDownExplicitBounds(-10, 10, .1, "-0.1") is "-0.2"
PASS stepDownExplicitBounds(-10, 10, .1, "-0.2") is "-0.3"
PASS stepDownExplicitBounds(-10, 10, .1, "-1.0") is "-1.1"
PASS stepDownExplicitBounds(-10, 10, .1, "-1.1") is "-1.2"
PASS stepDownExplicitBounds(-10, 10, .1, "-1.2") is "-1.3"
PASS stepDownExplicitBounds(-10, 10, .1, "-2.0") is "-2.1"
PASS stepUpExplicitBounds(-10, 10, .1, ".1") is "0.2"
PASS stepUpExplicitBounds(-10, 10, .1, ".2") is "0.3"
PASS stepUpExplicitBounds(-10, 10, .1, "1.") is "1.1"
PASS stepUpExplicitBounds(-10, 10, .1, "2.") is "2.1"
PASS stepUpExplicitBounds(-10, 10, .1, "-.1") is "0"
PASS stepUpExplicitBounds(-10, 10, .1, "-.2") is "-0.1"
PASS stepUpExplicitBounds(-10, 10, .1, "-1.") is "-0.9"
PASS stepUpExplicitBounds(-10, 10, .1, "-2.") is "-1.9"
PASS stepDownExplicitBounds(-10, 10, .1, ".1") is "0"
PASS stepDownExplicitBounds(-10, 10, .1, ".2") is "0.1"
PASS stepDownExplicitBounds(-10, 10, .1, "1.") is "0.9"
PASS stepDownExplicitBounds(-10, 10, .1, "2.") is "1.9"
PASS stepDownExplicitBounds(-10, 10, .1, "-.1") is "-0.2"
PASS stepDownExplicitBounds(-10, 10, .1, "-.2") is "-0.3"
PASS stepDownExplicitBounds(-10, 10, .1, "-1.") is "-1.1"
PASS stepDownExplicitBounds(-10, 10, .1, "-2.") is "-2.1"
Invalid step value
PASS stepUpExplicitBounds(null, null, "foo", "0") is "1"
PASS stepUpExplicitBounds(null, null, "0", "1") is "2"
PASS stepUpExplicitBounds(null, null, "-1", "2") is "3"
PASS stepDownExplicitBounds(null, null, "foo", "1") is "0"
PASS stepDownExplicitBounds(null, null, "0", "2") is "1"
PASS stepDownExplicitBounds(null, null, "-1", "3") is "2"
Step=any
PASS stepUpExplicitBounds(null, null, "any", "1") is "2"
PASS stepDownExplicitBounds(null, null, "any", "1") is "0"
Overflow/underflow
PASS stepUpExplicitBounds(null, "100", "1", "99") is "100"
PASS stepUpExplicitBounds(null, "100", "1", "100") is "100"
PASS stepUpExplicitBounds(null, "100", "1", "99", 2) is "100"
PASS stepDownExplicitBounds("0", null, "1", "1") is "0"
PASS stepDownExplicitBounds("0", null, "1", "0") is "0"
PASS stepDownExplicitBounds("0", null, "1", "1", 2) is "0"
PASS stepDownExplicitBounds(null, null, "3.40282346e+38", "1", 2) is "0"
PASS stepUpExplicitBounds(-100, 0, 1, -1) is "0"
PASS stepUpExplicitBounds(null, 0, 1, 0) is "0"
PASS stepUpExplicitBounds(-100, 0, 1, -1, 2) is "0"
PASS stepUpExplicitBounds(null, null, "3.40282346e+38", "1", 2) is "0"
stepDown()/stepUp() for stepMismatch values
PASS stepUpExplicitBounds(null, null, 2, 1) is "4"
PASS stepUpExplicitBounds(0, null, 10, 9, 9) is "100"
PASS stepDownExplicitBounds(0, null, 10, 19) is "10"
value + step is <= max, but rounded result would be > max.
PASS stepUpExplicitBounds(null, 99, 10, 89) is "90"
Huge value and small step
PASS stepUpExplicitBounds(0, 1e38, 1, 1e38, 999) is "1e+38"
PASS stepDownExplicitBounds(0, 1e38, 1, 1e38, 999) is "1e+38"
Fractional numbers
PASS stepUpExplicitBounds(null, null, 0.33333333333333333, 0, 3) is "1"
PASS stepUpExplicitBounds(null, null, 0.1, 1) is "1.1"
PASS stepUpExplicitBounds(null, null, 0.1, 1, 8) is "1.8"
PASS stepUpExplicitBounds(null, null, 0.1, 1, 10) is "2"
PASS stepUpExplicitBounds(0, 1, 0.003921568627450980, 0, 255) is "1"
PASS stepDownExplicitBounds(null, null, 0.1, 1, 8) is "0.2"
PASS stepDownExplicitBounds(null, null, 0.1, 1) is "0.9"
PASS successfullyParsed is true
TEST COMPLETE