summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2023-04-27 11:12:17 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2023-04-27 13:15:14 +1000
commita328ada6efc282a893ce4a283552a832197f6c94 (patch)
tree278fd92e8b5704e086399817dc5af1067a46b8b7
parenta9f4fdde0eb458e8986e34ce6842b26d9a6b989a (diff)
downloadlibinput-a328ada6efc282a893ce4a283552a832197f6c94.tar.gz
test: carry the step as argument for arg testing
Simplifies things a bit since it makes it all more explicit Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rwxr-xr-xtools/test_tool_option_parsing.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/test_tool_option_parsing.py b/tools/test_tool_option_parsing.py
index c1148948..c63d85e8 100755
--- a/tools/test_tool_option_parsing.py
+++ b/tools/test_tool_option_parsing.py
@@ -219,9 +219,9 @@ options = {
"set-profile": ["adaptive", "flat"],
"set-tap-map": ["lrm", "lmr"],
},
- # options with a range
+ # options with a range (and increment)
"ranges": {
- "set-speed": (float, -1.0, +1.0),
+ "set-speed": (-1.0, +1.0, 0.1),
},
}
@@ -250,9 +250,7 @@ def test_options_enums(libinput_debug_tool, option):
@pytest.mark.parametrize("option", options["ranges"].items())
def test_options_ranges(libinput_debug_tool, option):
name, values = option
- range_type, minimum, maximum = values
- assert range_type == float
- step = (maximum - minimum) / 10.0
+ minimum, maximum, step = values
value = minimum
while value < maximum:
libinput_debug_tool.run_command_success(["--{}".format(name), str(value)])