Add integration test coverage of insert spaces issue
This commit is contained in:
@@ -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.’
|
‘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”
|
“Tab-indented text”
|
||||||
|
|
||||||
>“Paragraph-indented text”
|
>“Paragraph-indented text”
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?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>
|
<project>
|
||||||
<name>New Project</name>
|
<name>New Project</name>
|
||||||
<title></title>
|
<title></title>
|
||||||
@@ -15,8 +15,8 @@
|
|||||||
<autoOutline>True</autoOutline>
|
<autoOutline>True</autoOutline>
|
||||||
<lastEdited>0e17daca5f3e1</lastEdited>
|
<lastEdited>0e17daca5f3e1</lastEdited>
|
||||||
<lastViewed>None</lastViewed>
|
<lastViewed>None</lastViewed>
|
||||||
<lastWordCount>126</lastWordCount>
|
<lastWordCount>142</lastWordCount>
|
||||||
<novelWordCount>99</novelWordCount>
|
<novelWordCount>115</novelWordCount>
|
||||||
<notesWordCount>27</notesWordCount>
|
<notesWordCount>27</notesWordCount>
|
||||||
<autoReplace/>
|
<autoReplace/>
|
||||||
<titleFormat>
|
<titleFormat>
|
||||||
@@ -85,10 +85,10 @@
|
|||||||
<status>New</status>
|
<status>New</status>
|
||||||
<exported>True</exported>
|
<exported>True</exported>
|
||||||
<layout>DOCUMENT</layout>
|
<layout>DOCUMENT</layout>
|
||||||
<charCount>612</charCount>
|
<charCount>693</charCount>
|
||||||
<wordCount>95</wordCount>
|
<wordCount>111</wordCount>
|
||||||
<paraCount>10</paraCount>
|
<paraCount>12</paraCount>
|
||||||
<cursorPos>768</cursorPos>
|
<cursorPos>917</cursorPos>
|
||||||
</item>
|
</item>
|
||||||
<item handle="44cb730c42048" order="1" parent="None">
|
<item handle="44cb730c42048" order="1" parent="None">
|
||||||
<name>Plot</name>
|
<name>Plot</name>
|
||||||
|
|||||||
@@ -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)
|
||||||
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
|
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
|
||||||
|
|
||||||
|
# Auto-Replace
|
||||||
|
# ============
|
||||||
|
|
||||||
for c in (
|
for c in (
|
||||||
"This is another paragraph of much longer nonsense text. "
|
"This is another paragraph of much longer nonsense text. "
|
||||||
"It is in fact 1 very very NONSENSICAL 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)
|
||||||
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\"":
|
for c in "\t\"Tab-indented text\"":
|
||||||
qtbot.keyClick(nwGUI.docEditor, c, delay=typeDelay)
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user