Skip to content

Commit e1865ea

Browse files
committed
add test case for including chapter 1 and header information
1 parent 707119c commit e1865ea

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

tests/corpora/test_update_usfm_parser_handler.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,6 +1530,34 @@ def test_filter_chapters() -> None:
15301530
assert_usfm_equals(target, result)
15311531

15321532

1533+
def test_filter_chapters_with_chapter_1_and_header() -> None:
1534+
usfm = r"""\id MAT - Test
1535+
\h Matthew
1536+
\c 1
1537+
\v 1 Some text
1538+
\v 2
1539+
\v 3 Other text
1540+
\c 2
1541+
\v 1 Some text
1542+
\c 3
1543+
\v 1 Some text
1544+
\c 4
1545+
\v 1 Some text
1546+
"""
1547+
chapters = [1, 3]
1548+
target = update_usfm(chapters=chapters, source=usfm)
1549+
result = r"""\id MAT - Test
1550+
\h Matthew
1551+
\c 1
1552+
\v 1 Some text
1553+
\v 2
1554+
\v 3 Other text
1555+
\c 3
1556+
\v 1 Some text
1557+
"""
1558+
assert_usfm_equals(target, result)
1559+
1560+
15331561
def scr_ref(*refs: str) -> List[ScriptureRef]:
15341562
return [ScriptureRef.parse(ref) for ref in refs]
15351563

0 commit comments

Comments
 (0)