Skip to content

Commit a4a1eaa

Browse files
committed
Add support for hex values
1 parent 6b990c4 commit a4a1eaa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

framework/src/act/select_tests.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@
1717
ConfigParamValue = int | bool | str | list[int | str | bool]
1818

1919
# Parameter constraint comparison operators
20-
_COMPARISON_RE = re.compile(r"^(>=|<=|!=|==|>|<)\s*(\d+)$")
20+
_COMPARISON_RE = re.compile(r"^(>=|<=|!=|==|>|<)\s*(0[xX][0-9a-fA-F]+|\d+)$")
2121

2222

2323
def _compare_param(test_value: object, config_value: object) -> bool:
2424
"""Compare a test parameter requirement against a config parameter value.
2525
26-
Supports comparison operator prefixes on string values:
27-
e.g. '>=128', '<= 64', '> 0', '<256', '!=0', '==64'.
28-
Falls back to exact equality for all other values.
26+
Supports comparison operator prefixes on strings with decimal or hex values.
27+
e.g. '>=128', '<= 64', '> 0', '<256', '!=0', '==64', '>=0x80', '<0xFF'.
28+
Falls back to exact equality if there is no comparison operator prefix.
2929
"""
3030
if isinstance(test_value, str):
3131
match = _COMPARISON_RE.match(test_value)
3232
if match:
3333
op, required_val = match.groups()
34-
required_val = int(required_val)
34+
required_val = int(required_val, 0)
3535
if type(config_value) is not int:
3636
return False
3737
if op == ">=":

0 commit comments

Comments
 (0)