Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pwwang committed Dec 11, 2023
1 parent fa30426 commit c147a52
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,10 @@ def test_isempty(tmp_path):
fi.write_text("\n")
assert f.isempty(fi) is True
assert f.isempty(fi, ignore_ws=False) is False


def test_regex_replace():
assert f.regex_replace("a", "a", "b") == "b"
assert f.regex_replace("a", "a", "b", count=1) == "b"
assert f.regex_replace("a", "a", "b", flags=0) == "b"
assert f.regex_replace("a1b2c3", r"(\d+)", "x\\1") == "ax1bx2cx3"

0 comments on commit c147a52

Please sign in to comment.