Fix chapter numbering in refactored tokenizer and add test coverage

This commit is contained in:
Veronica Berglyd Olsen
2024-03-13 11:08:49 +01:00
parent 44a0d21b35
commit c7e953fc24
2 changed files with 30 additions and 23 deletions
+9
View File
@@ -1843,9 +1843,12 @@ def testCoreToken_HeaderCounterAndVisibility(mockGUI):
# Counter Handling, Novel Titles
# ==============================
# This also checks that only numbered chapters bump the counter
md._text = (
"#! Novel One\n\n"
"##! Prologue\n\n"
"Text\n\n"
"## Chapter One\n\n"
"### Scene One\n\n"
"Text\n\n"
@@ -1857,6 +1860,8 @@ def testCoreToken_HeaderCounterAndVisibility(mockGUI):
"###! Scene Four\n\n"
"Text\n\n"
"#! Novel Two\n\n"
"##! Prologue\n\n"
"Text\n\n"
"## Chapter One\n\n"
"### Scene One\n\n"
"Text\n\n"
@@ -1883,6 +1888,8 @@ def testCoreToken_HeaderCounterAndVisibility(mockGUI):
md.doConvert()
assert md.result == (
"# Novel One\n\n"
"## Prologue\n\n"
"Text\n\n"
"## C 1: Chapter One\n\n"
"### S 1.1 (1): Scene One\n\n"
"Text\n\n"
@@ -1894,6 +1901,8 @@ def testCoreToken_HeaderCounterAndVisibility(mockGUI):
"### H 2.2 (4): Scene Four\n\n"
"Text\n\n"
"# Novel Two\n\n"
"## Prologue\n\n"
"Text\n\n"
"## C 1: Chapter One\n\n"
"### S 1.1 (1): Scene One\n\n"
"Text\n\n"