-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve: Escape square brackets less (#464)
- Loading branch information
Showing
5 changed files
with
130 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import pytest | ||
|
||
from mdformat.renderer import _util | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"in_, indexes, out", | ||
[ | ||
("text", [0], ["", "text"]), | ||
("text", [3], ["tex", "t"]), | ||
("text", [4], ["text", ""]), | ||
( | ||
"lorem dipsum iksum lopsum", | ||
[0, 1, 6, 7], | ||
["", "l", "orem ", "d", "ipsum iksum lopsum"], | ||
), | ||
], | ||
) | ||
def test_split_at_indexes(in_, indexes, out): | ||
assert _util.split_at_indexes(in_, indexes) == out | ||
|
||
|
||
def test_split_at_indexes__valueerror(): | ||
with pytest.raises(ValueError) as exc_info: | ||
_util.split_at_indexes("testtext", ()) | ||
assert "indexes must not be empty" in str(exc_info.value) |