Skip to content

Commit

Permalink
Use to_match_string for debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kannibalox committed Mar 15, 2024
1 parent b9ffcd0 commit cfdc03b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/pyrosimple/scripts/rtcontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ def mainloop(self):
# Use validate_sort_fields to pre-validate key names
rtorrent.validate_sort_fields(",".join(key_names))
matcher = matching.MatcherBuilder().visit(query_tree)
self.log.debug("Matcher is: %s", matcher)
self.log.debug("Matcher is: %s", matcher.to_match_string())

# View handling
if self.options.modify_view:
Expand Down
2 changes: 2 additions & 0 deletions src/tests/test_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ def test_conditions_prefilter(cond, expected):
)
def test_matcher(matcher, item):
m = matching.create_matcher(matcher)
assert m.to_match_string()
assert m.match(item)


Expand Down Expand Up @@ -339,6 +340,7 @@ def test_matcher_prefilter(matcher, item):
("size<1G", "size<1.0G"),
("is_complete=no", "is_complete=no"),
("is_complete=no name=arch", "is_complete=no name=arch"),
("is_complete=no OR name=arch", "is_complete=no OR name=arch"),
],
)
def test_matcher_representation(matcher, string):
Expand Down

0 comments on commit cfdc03b

Please sign in to comment.