1 Check stepping-up and -down for number input from renderer.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
7 Function arguments are (value, step, {min or max}, [stepCount]).
9 PASS stepUp("", null, null) is "1"
10 PASS stepDown("", null, null) is "-1"
11 PASS stepUp("", "any", null) is "1"
12 PASS stepDown("", "any", null) is "-1"
13 PASS stepUp("", "foo", null) is "1"
14 PASS stepDown("", "foo", null) is "-1"
15 PASS stepUp("foo", null, null) is "1"
16 PASS stepDown("foo", null, null) is "-1"
17 PASS stepUp("foo", "any", null) is "1"
18 PASS stepDown("foo", "any", null) is "-1"
19 PASS stepUp("foo", "foo", null) is "1"
20 PASS stepDown("foo", "foo", null) is "-1"
22 PASS stepUp("0", null, null) is "1"
23 PASS stepUp("1", null, null, 2) is "3"
24 PASS stepUp("3", null, null, -1) is "2"
25 PASS stepDown("2", null, null) is "1"
26 PASS stepDown("1", null, null, 2) is "-1"
27 PASS stepDown("-1", null, null, -1) is "0"
29 PASS stepUp("0", "foo", null) is "1"
30 PASS stepUp("1", "0", null) is "2"
31 PASS stepUp("2", "-1", null) is "3"
33 PASS stepUp("0", "any", null) is "1"
34 PASS stepDown("0", "any", null) is "-1"
36 PASS stepUpExplicitBounds("0", "100", "any", "1.5", "1") is "2.5"
37 PASS stepDownExplicitBounds("0", "100", "any", "1.5", "1") is "0.5"
39 PASS stepDown("1", "1", "0") is "0"
40 PASS stepDown("0", "1", "0") is "0"
41 PASS stepDown("1", "1", "0", 2) is "0"
42 PASS stepDown("1", "1.797693134862315e+308", "", 2) is "-1.797693134862315e+308"
43 PASS stepUp("-1", "1", "0") is "0"
44 PASS stepUp("0", "1", "0") is "0"
45 PASS stepUp("-1", "1", "0", 2) is "0"
46 PASS stepUp("1", "1.797693134862315e+308", "", 2) is "1.797693134862315e+308"
47 stepDown()/stepUp() for stepMismatch values
48 PASS stepUp("1", "2", "") is "2"
49 PASS input.min = "0"; stepUp("9", "10", "") is "10"
50 PASS stepDown("19", "10", "0") is "10"
51 PASS stepUp("89", "10", "99") is "90"
52 PASS stepUp("7", "300", "") is "300"
53 PASS stepUp("-7", "300", "") is "0"
54 PASS stepDown("7", "300", "") is "0"
55 PASS stepDown("-7", "300", "") is "-300"
56 Huge value and small step
57 PASS input.min = ""; stepUp("1e+308", "1", "", 999) is "1e+308"
58 PASS input.max = ""; stepDown("1e+308", "1", "", 999) is "1e+308"
60 PASS input.min = ""; stepUp("0", "0.33333333333333333", "", 3) is "1"
61 PASS stepUp("1", "0.1", "", 10) is "2"
62 PASS input.min = "0"; stepUp("0", "0.003921568627450980", "1", 255) is "1"
64 PASS stepUp("5.005", "0.005", "", 2) is "5.015"
65 PASS stepUp("5.005", "0.005", "", 11) is "5.06"
66 PASS stepUp("5.005", "0.005", "", 12) is "5.065"
67 PASS stepUpExplicitBounds("4", "9", "0.005", "5.005", 2) is "5.015"
68 PASS stepUpExplicitBounds("4", "9", "0.005", "5.005", 11) is "5.06"
69 PASS stepUpExplicitBounds("4", "9", "0.005", "5.005", 12) is "5.065"
70 PASS stepUpExplicitBounds(-4, 4, 1, "") is "1"
71 PASS stepDownExplicitBounds(-4, 4, 1, "") is "-1"
72 PASS stepDownExplicitBounds(0, 4, 1, "") is "0"
73 PASS stepUpExplicitBounds(-4, 0, 1, "") is "0"
74 PASS stepDownExplicitBounds(1, 4, 1, "") is "1"
75 PASS stepUpExplicitBounds(1, 4, 1, "") is "1"
76 PASS stepDownExplicitBounds(-4, -1, 1, "") is "-1"
77 PASS stepUpExplicitBounds(-4, -1, 1, "") is "-1"
78 PASS stepUpExplicitBounds(-100, null, 3, "") is "2"
79 PASS stepDownExplicitBounds(-100, null, 3, "") is "-1"
80 PASS stepUpExplicitBounds(1, 4, 1, 0) is "1"
81 PASS stepDownExplicitBounds(1, 4, 1, 0) is "0"
82 PASS stepDownExplicitBounds(-4, -1, 1, 0) is "-1"
83 PASS stepUpExplicitBounds(-4, -1, 1, 0) is "0"
84 PASS stepUpExplicitBounds(-100, null, 3, 3) is "5"
85 PASS stepDownExplicitBounds(-100, null, 3, 3) is "2"
87 PASS successfullyParsed is true