Skip to content

Commit

Permalink
Keep order when matching operators, put ~ at the end
Browse files Browse the repository at this point in the history
Otherwise the new operator `~` matches other operators starting
with tilda, for example `~>=`.
  • Loading branch information
psss committed Jan 6, 2025
1 parent bd1ec88 commit 80b4b6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fmf/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,14 @@ def _op_core(self, dimension_name, values, comparator):
"~<=": _op_minor_less_or_eq,
"==": _op_eq,
"~=": _op_minor_eq,
"~": _op_match,
"!=": _op_not_eq,
"~!=": _op_minor_not_eq,
"!~": _op_not_match,
">=": _op_greater_or_equal,
"~>=": _op_minor_greater_or_equal,
">": _op_greater,
"~>": _op_minor_greater,
"~": _op_match,
"!~": _op_not_match,
}

# Triple expression: dimension operator values
Expand All @@ -400,7 +400,7 @@ def _op_core(self, dimension_name, values, comparator):
r"(\w+)"
+ r"\s*("
+ r"|".join(
set(operator_map.keys()) - {"is defined", "is not defined"})
[key for key in operator_map if key not in ["is defined", "is not defined"]])
+ r")\s*"
+ r"([^=].*)")
# Double expression: dimension operator
Expand Down

0 comments on commit 80b4b6e

Please sign in to comment.