Skip to content

Commit

Permalink
fix: use raw strings when backslashes
Browse files Browse the repository at this point in the history
  • Loading branch information
akaihola committed Aug 29, 2024
1 parent e52d2da commit eb6b41a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Empty file added mypy.ini
Empty file.
6 changes: 3 additions & 3 deletions tests/basic/test_editblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def setUp(self):

def test_find_filename(self):
fence = ("```", "```")
valid_fnames = ["file1.py", "file2.py", "dir/file3.py", "\windows\__init__.py"]
valid_fnames = ["file1.py", "file2.py", "dir/file3.py", r"\windows\__init__.py"]

# Test with filename on a single line
lines = ["file1.py", "```"]
Expand All @@ -45,8 +45,8 @@ def test_find_filename(self):
self.assertEqual(eb.find_filename(lines, fence, valid_fnames), "file1.py")

# Test with fuzzy matching
lines = ["\windows__init__.py", "```"]
self.assertEqual(eb.find_filename(lines, fence, valid_fnames), "\windows\__init__.py")
lines = [r"\windows__init__.py", "```"]
self.assertEqual(eb.find_filename(lines, fence, valid_fnames), r"\windows\__init__.py")

# fuzzy logic disabled v0.11.2-dev
def __test_replace_most_similar_chunk(self):
Expand Down

0 comments on commit eb6b41a

Please sign in to comment.