test: carry the step as argument for arg testing
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 27 Apr 2023 01:12:17 +0000 (11:12 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 27 Apr 2023 03:15:14 +0000 (13:15 +1000)
Simplifies things a bit since it makes it all more explicit

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tools/test_tool_option_parsing.py

index c11489483f4f20d0a01ef94436489087ca4c9ade..c63d85e8b2e26f69949fd078f911433fa2230e98 100755 (executable)
@@ -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)])