Add test coverage of the highlighter
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
%%~name: New Scene
|
||||
%%~path: 000000000000d/000000000000f
|
||||
%%~kind: NOVEL/DOCUMENT
|
||||
%%~hash: 2a863dc53e09b0b1b0294ae7ea001853dddd596d
|
||||
%%~date: 2023-10-17 20:52:56/2023-10-17 20:53:01
|
||||
%%~hash: 0566024662fb6ed7ed645717addd64dabf058915
|
||||
%%~date: 2024-10-27 13:03:13/2024-10-27 13:03:18
|
||||
# Novel
|
||||
|
||||
## Chapter
|
||||
@@ -34,6 +34,10 @@ This is another paragraph of much longer nonsense text. It is in fact 1 very ver
|
||||
|
||||
Some “ double quoted text with spaces padded ”.
|
||||
|
||||
– Hi, I am a character speaking.
|
||||
|
||||
– Hi, I am also a character speaking, – said another character. – How are you?
|
||||
|
||||
@object: NoSpaceAdded
|
||||
|
||||
% synopsis: No space before this colon.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<novelWriterXML appVersion="2.4rc1" hexVersion="0x020400c1" fileVersion="1.5" fileRevision="3" timeStamp="2024-04-14 23:46:11">
|
||||
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="3" autoCount="2" editTime="3">
|
||||
<novelWriterXML appVersion="2.6a3" hexVersion="0x020600a3" fileVersion="1.5" fileRevision="4" timeStamp="2024-10-27 13:01:24">
|
||||
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="3" autoCount="2" editTime="6">
|
||||
<name>New Project</name>
|
||||
<author>Jane Doe</author>
|
||||
</project>
|
||||
@@ -28,7 +28,7 @@
|
||||
<entry key="i000007" count="0" red="50" green="200" blue="0" shape="SQUARE">Main</entry>
|
||||
</importance>
|
||||
</settings>
|
||||
<content items="11" novelWords="142" notesWords="27">
|
||||
<content items="11" novelWords="161" notesWords="27">
|
||||
<item handle="0000000000008" parent="None" root="0000000000008" order="0" type="ROOT" class="NOVEL">
|
||||
<meta expanded="yes" />
|
||||
<name status="s000000" import="i000004">Novel</name>
|
||||
@@ -46,7 +46,7 @@
|
||||
<name status="s000000" import="i000004" active="yes">New Chapter</name>
|
||||
</item>
|
||||
<item handle="000000000000f" parent="000000000000d" root="0000000000008" order="1" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H1" charCount="808" wordCount="135" paraCount="15" cursorPos="1026" />
|
||||
<meta expanded="no" heading="H1" charCount="918" wordCount="154" paraCount="17" cursorPos="1140" />
|
||||
<name status="s000000" import="i000004" active="yes">New Scene</name>
|
||||
</item>
|
||||
<item handle="0000000000009" parent="None" root="0000000000009" order="1" type="ROOT" class="PLOT">
|
||||
|
||||
@@ -258,7 +258,6 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, projPath, tstPaths, mockRnd):
|
||||
# Syntax Highlighting
|
||||
CONFIG.dialogStyle = 3
|
||||
CONFIG.dialogLine = "–"
|
||||
CONFIG.narratorBreak = "–"
|
||||
CONFIG.altDialogOpen = "<|"
|
||||
CONFIG.altDialogClose = "|>"
|
||||
|
||||
@@ -431,6 +430,9 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, projPath, tstPaths, mockRnd):
|
||||
qtbot.keyClick(docEditor, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
qtbot.keyClick(docEditor, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
|
||||
# Dialogue
|
||||
# ========
|
||||
|
||||
for c in "\"Full line double quoted text.\"":
|
||||
qtbot.keyClick(docEditor, c, delay=KEY_DELAY)
|
||||
qtbot.keyClick(docEditor, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
@@ -453,6 +455,25 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, projPath, tstPaths, mockRnd):
|
||||
docEditor._typPadBefore = ""
|
||||
docEditor._typPadAfter = ""
|
||||
|
||||
# Dialogue Line
|
||||
for c in "-- Hi, I am a character speaking.":
|
||||
qtbot.keyClick(docEditor, c, delay=KEY_DELAY)
|
||||
qtbot.keyClick(docEditor, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
qtbot.keyClick(docEditor, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
|
||||
# Narrator Break
|
||||
CONFIG.narratorBreak = "–"
|
||||
docEditor = nwGUI.docEditor
|
||||
docEditor._qDocument.syntaxHighlighter.initHighlighter()
|
||||
|
||||
for c in "-- Hi, I am also a character speaking, -- said another character. -- How are you?":
|
||||
qtbot.keyClick(docEditor, c, delay=KEY_DELAY)
|
||||
qtbot.keyClick(docEditor, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
qtbot.keyClick(docEditor, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
|
||||
# Special Formatting
|
||||
# ==================
|
||||
|
||||
# Insert spaces before colon, but ignore tags and synopsis
|
||||
docEditor._typPadBefore = ":"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user