Skip to content

Commit

Permalink
test(util): add windows line-endings possibilities for commit parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
codejedi365 authored and relekang committed Feb 8, 2024
1 parent 8e3c00b commit c57b082
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/unit/semantic_release/commit_parser/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@
"text, expected",
[
("", []),
("\n\n \n\n \n", [" ", " "]),
("\n\n \n\n \n", []), # Unix (LF) - empty lines
("\r\n\r\n \r\n\r\n \n", []), # Windows (CRLF) - empty lines
("\n\nA\n\nB\n", ["A", "B"]), # Unix (LF)
("\r\n\r\nA\r\n\r\nB\n", ["A", "B"]), # Windows (CRLF)
(
"Long\nexplanation\n\nfull of interesting\ndetails",
["Long explanation", "full of interesting details"],
),
(
# Windows (CRLF)
"Long\r\nexplanation\r\n\r\nfull of interesting\r\ndetails",
["Long explanation", "full of interesting details"],
),
],
)
def test_parse_paragraphs(text, expected):
Expand Down

0 comments on commit c57b082

Please sign in to comment.