diff test/test_liveserver.py @ 8290:51f277ed8adc

test: fix fuzz test CI found a new condition that passes but isn't filtered as passing. '0 #stuff' The space is acceptable at the end of a sring otf numbers. New filter allows this to pass. Added an example of this type of value.
author John Rouillard <rouilj@ieee.org>
date Sat, 18 Jan 2025 19:08:16 -0500
parents 669dfccca898
children 0663a7bcef6c
line wrap: on
line diff
--- a/test/test_liveserver.py	Sat Jan 18 17:43:08 2025 -0500
+++ b/test/test_liveserver.py	Sat Jan 18 19:08:16 2025 -0500
@@ -234,6 +234,7 @@
            text(min_size=1))
     @example("@verbose", "1#")
     @example("@verbose", "#1stuff")
+    @example("@verbose", "0 #stuff")
     @settings(max_examples=_max_examples,
               deadline=fuzz_deadline) # in ms
     def test_class_url_param_accepting_integer_values(self, param, value):
@@ -245,8 +246,8 @@
         query = '%s=%s'  % (param, value)
         f = session.get(url, params=query)
         try:
-            # test case '0#' '12345#stuff' '12345&stuff'
-            match = re.match('(^[0-9]*)[#&]', value)
+            # test case '0 #', '0#', '12345#stuff' '12345&stuff'
+            match = re.match(r'(^[0-9]*\s*)[#&]', value)
             if match is not None:
                 value = match[1]
             elif int(value) >= 0:

Roundup Issue Tracker: http://roundup-tracker.org/