Add integration test coverage of insert spaces issue

This commit is contained in:
Veronica Berglyd Olsen
2022-09-29 14:25:42 +02:00
parent e6b2732281
commit 5adf21e87a
3 changed files with 53 additions and 7 deletions
@@ -27,6 +27,14 @@ This is another paragraph of much longer nonsense text. It is in fact 1 very ver
Full line single quoted text.
Some “ double quoted text with spaces padded ”.
@object: NoSpaceAdded
% synopsis: No space before this colon.
Add space before this colon : See?
“Tab-indented text”
>“Paragraph-indented text”
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="1.5-beta2" hexVersion="0x010500b2" fileVersion="1.3" timeStamp="2021-08-31 00:03:45">
<novelWriterXML appVersion="1.6.3" hexVersion="0x010603f0" fileVersion="1.3" timeStamp="2022-09-29 14:24:23">
<project>
<name>New Project</name>
<title></title>
@@ -15,8 +15,8 @@
<autoOutline>True</autoOutline>
<lastEdited>0e17daca5f3e1</lastEdited>
<lastViewed>None</lastViewed>
<lastWordCount>126</lastWordCount>
<novelWordCount>99</novelWordCount>
<lastWordCount>142</lastWordCount>
<novelWordCount>115</novelWordCount>
<notesWordCount>27</notesWordCount>
<autoReplace/>
<titleFormat>
@@ -85,10 +85,10 @@
<status>New</status>
<exported>True</exported>
<layout>DOCUMENT</layout>
<charCount>612</charCount>
<wordCount>95</wordCount>
<paraCount>10</paraCount>
<cursorPos>768</cursorPos>
<charCount>693</charCount>
<wordCount>111</wordCount>
<paraCount>12</paraCount>
<cursorPos>917</cursorPos>
</item>
<item handle="44cb730c42048" order="1" parent="None">
<name>Plot</name>
+38
View File
@@ -340,6 +340,9 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, fncProj, refDir, outDir):
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
# Auto-Replace
# ============
for c in (
"This is another paragraph of much longer nonsense text. "
"It is in fact 1 very very NONSENSICAL nonsense text! "
@@ -373,6 +376,41 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, fncProj, refDir, outDir):
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
# Insert spaces before and after quotes
nwGUI.mainConf.fmtPadBefore = "\u201d"
nwGUI.mainConf.fmtPadAfter = "\u201c"
for c in "Some \"double quoted text with spaces padded\".":
qtbot.keyClick(nwGUI.docEditor, c, delay=typeDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
nwGUI.mainConf.fmtPadBefore = ""
nwGUI.mainConf.fmtPadAfter = ""
# Insert spaces before colon, but ignore tags and synopsis
nwGUI.mainConf.fmtPadBefore = ":"
for c in "@object: NoSpaceAdded":
qtbot.keyClick(nwGUI.docEditor, c, delay=typeDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
for c in "% synopsis: No space before this colon.":
qtbot.keyClick(nwGUI.docEditor, c, delay=typeDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
for c in "Add space before this colon: See?":
qtbot.keyClick(nwGUI.docEditor, c, delay=typeDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
nwGUI.mainConf.fmtPadBefore = ""
# Indent and Align
# ================
for c in "\t\"Tab-indented text\"":
qtbot.keyClick(nwGUI.docEditor, c, delay=typeDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)