From c6a22e2d96e1f30b98c2b6f3086511aecd52d407 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:46:06 +0100 Subject: [PATCH] Add stats variables to Lipsum test project --- tests/lipsum/content/7a992350f3eb6.nwd | 8 ++++-- tests/lipsum/nwProject.nwx | 12 ++++----- .../coreIndex_LoadSave_tagsIndex.json | 2 +- .../reference/fmtToDocX_SaveDocument_app.xml | 12 ++++----- .../reference/fmtToDocX_SaveDocument_core.xml | 6 ++--- .../fmtToDocX_SaveDocument_document.xml | 26 +++++++++++++++++++ .../fmtToDocX_SaveDocument_settings.xml | 14 +++++----- .../reference/guiOutline_Content_outline.csv | 2 +- ...dDocBuild_Extended_Markdown_Lorem_Ipsum.md | 4 +++ .../mBuildDocBuild_HTML5_Lorem_Ipsum.htm | 2 ++ .../mBuildDocBuild_HTML5_Lorem_Ipsum.json | 6 +++-- .../mBuildDocBuild_NWD_Lorem_Ipsum.json | 8 ++++-- .../mBuildDocBuild_NWD_Lorem_Ipsum.txt | 4 +++ ...uildDocBuild_OpenDocument_Lorem_Ipsum.fodt | 26 ++++++++++--------- ...dDocBuild_Standard_Markdown_Lorem_Ipsum.md | 4 +++ tests/test_gui/test_gui_doceditor.py | 8 +++--- tests/test_gui/test_gui_outline.py | 6 ++--- tests/test_tools/test_tools_noveldetails.py | 12 ++++----- 18 files changed, 107 insertions(+), 55 deletions(-) diff --git a/tests/lipsum/content/7a992350f3eb6.nwd b/tests/lipsum/content/7a992350f3eb6.nwd index f36d5e4d..c57db169 100644 --- a/tests/lipsum/content/7a992350f3eb6.nwd +++ b/tests/lipsum/content/7a992350f3eb6.nwd @@ -1,12 +1,16 @@ %%~name: Lorem Ipsum %%~path: b3643d0f92e32/7a992350f3eb6 %%~kind: NOVEL/DOCUMENT -%%~hash: 8efda028000b70be0d7dbe9647b6026082ef05c9 -%%~date: Unknown/Unknown +%%~hash: 370be3057fb6c0e0b5e4858915a37da18ffc7675 +%%~date: Unknown/2024-10-28 18:18:37 #! Lorem Ipsum >> **By lipsum.com** << +>> Word Count: [field:allWords] << + +>> Character Count: [field:allChars] << + >> “Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…” << >> “There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…” << diff --git a/tests/lipsum/nwProject.nwx b/tests/lipsum/nwProject.nwx index 42dddbe6..8da7d6cc 100644 --- a/tests/lipsum/nwProject.nwx +++ b/tests/lipsum/nwProject.nwx @@ -1,6 +1,6 @@ - - + + Lorem Ipsum lipsum.com @@ -9,7 +9,7 @@ en_GB None - 88d59a277361b + 7a992350f3eb6 None b3643d0f92e32 None @@ -31,17 +31,17 @@ Main - + Novel - + Lorem Ipsum - + Front Matter diff --git a/tests/reference/coreIndex_LoadSave_tagsIndex.json b/tests/reference/coreIndex_LoadSave_tagsIndex.json index 9a6c8e6e..4412cd18 100644 --- a/tests/reference/coreIndex_LoadSave_tagsIndex.json +++ b/tests/reference/coreIndex_LoadSave_tagsIndex.json @@ -7,7 +7,7 @@ "novelWriter.itemIndex": { "7a992350f3eb6": { "headings": { - "T0001": {"level": "H1", "title": "Lorem Ipsum", "line": 1, "tag": "", "cCount": 230, "wCount": 40, "pCount": 3, "synopsis": ""} + "T0001": {"level": "H1", "title": "Lorem Ipsum", "line": 1, "tag": "", "cCount": 259, "wCount": 44, "pCount": 5, "synopsis": ""} } }, "8c58a65414c23": { diff --git a/tests/reference/fmtToDocX_SaveDocument_app.xml b/tests/reference/fmtToDocX_SaveDocument_app.xml index 2b23457d..59d08d55 100644 --- a/tests/reference/fmtToDocX_SaveDocument_app.xml +++ b/tests/reference/fmtToDocX_SaveDocument_app.xml @@ -1,9 +1,9 @@ - 39 - novelWriter/2.6a2 - 4031 - 21271 - 24935 - 43 + 40 + novelWriter/2.6a3 + 4035 + 21296 + 24964 + 45 diff --git a/tests/reference/fmtToDocX_SaveDocument_core.xml b/tests/reference/fmtToDocX_SaveDocument_core.xml index 298cdff1..1e503ab2 100644 --- a/tests/reference/fmtToDocX_SaveDocument_core.xml +++ b/tests/reference/fmtToDocX_SaveDocument_core.xml @@ -1,10 +1,10 @@ - 2024-10-26T17:01:14 - 2024-10-26T17:01:14 + 2024-10-28T18:23:43 + 2024-10-28T18:23:43 lipsum.com Lorem Ipsum en-GB - 48 + 50 lipsum.com diff --git a/tests/reference/fmtToDocX_SaveDocument_document.xml b/tests/reference/fmtToDocX_SaveDocument_document.xml index a464186f..4d840bc5 100644 --- a/tests/reference/fmtToDocX_SaveDocument_document.xml +++ b/tests/reference/fmtToDocX_SaveDocument_document.xml @@ -23,6 +23,32 @@ By lipsum.com + + + + + + + + Word Count: + + + 4,035 + + + + + + + + + + Character Count: + + + 27,064 + + diff --git a/tests/reference/fmtToDocX_SaveDocument_settings.xml b/tests/reference/fmtToDocX_SaveDocument_settings.xml index 3d8dd1db..10913023 100644 --- a/tests/reference/fmtToDocX_SaveDocument_settings.xml +++ b/tests/reference/fmtToDocX_SaveDocument_settings.xml @@ -8,15 +8,15 @@ - - - + + + - - + + - - + + diff --git a/tests/reference/guiOutline_Content_outline.csv b/tests/reference/guiOutline_Content_outline.csv index 5a275769..15ca2c46 100644 --- a/tests/reference/guiOutline_Content_outline.csv +++ b/tests/reference/guiOutline_Content_outline.csv @@ -1,5 +1,5 @@ "Title","Document","Words","Pars","POV","Characters","Plot","Locations","Synopsis" -"Lorem Ipsum","Lorem Ipsum","40","3","","","","","" +"Lorem Ipsum","Lorem Ipsum","44","5","","","","","" "Prologue","Prologue","94","2","","","","","Explanation from the lipsum.com website." "Act One","Act One","6","1","","","","","" "Chapter One","Chapter One","67","1","Bod","","Main","Europe","Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque at aliquam quam." diff --git a/tests/reference/mBuildDocBuild_Extended_Markdown_Lorem_Ipsum.md b/tests/reference/mBuildDocBuild_Extended_Markdown_Lorem_Ipsum.md index 925a15c5..a9627afd 100644 --- a/tests/reference/mBuildDocBuild_Extended_Markdown_Lorem_Ipsum.md +++ b/tests/reference/mBuildDocBuild_Extended_Markdown_Lorem_Ipsum.md @@ -2,6 +2,10 @@ **By lipsum.com** +Word Count: 4,169 + +Character Count: 27,898 + “Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…” “There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…” diff --git a/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.htm b/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.htm index c30f2ca4..3a6a9cd0 100644 --- a/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.htm +++ b/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.htm @@ -21,6 +21,8 @@ h4 {margin-top: 1.53em; margin-bottom: 0.65em;}

Lorem Ipsum

By lipsum.com

+

Word Count: 4,169

+

Character Count: 27,898

“Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…”

“There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…”

Comment: Exctracted from the lipsum.com website.

diff --git a/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.json b/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.json index 6e9df57b..b4a31f8d 100644 --- a/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.json +++ b/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.json @@ -2,8 +2,8 @@ "meta": { "projectName": "Lorem Ipsum", "novelAuthor": "lipsum.com", - "buildTime": 1729877010, - "buildTimeStr": "2024-10-25 19:23:30" + "buildTime": 1730136403, + "buildTimeStr": "2024-10-28 18:26:43" }, "text": { "css": [ @@ -23,6 +23,8 @@ [ "

Lorem Ipsum

", "

By lipsum.com

", + "

Word Count: 4,169

", + "

Character Count: 27,898

", "

\u201cNeque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit\u2026\u201d

", "

\u201cThere is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain\u2026\u201d

" ], diff --git a/tests/reference/mBuildDocBuild_NWD_Lorem_Ipsum.json b/tests/reference/mBuildDocBuild_NWD_Lorem_Ipsum.json index ce7f456b..e3b1ccee 100644 --- a/tests/reference/mBuildDocBuild_NWD_Lorem_Ipsum.json +++ b/tests/reference/mBuildDocBuild_NWD_Lorem_Ipsum.json @@ -2,8 +2,8 @@ "meta": { "projectName": "Lorem Ipsum", "novelAuthor": "lipsum.com", - "buildTime": 1729877010, - "buildTimeStr": "2024-10-25 19:23:30" + "buildTime": 1730136328, + "buildTimeStr": "2024-10-28 18:25:28" }, "text": { "nwd": [ @@ -12,6 +12,10 @@ "", ">> **By lipsum.com** <<", "", + ">> Word Count: [field:allWords] <<", + "", + ">> Character Count: [field:allChars] <<", + "", ">> \u201cNeque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit\u2026\u201d <<", "", ">> \u201cThere is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain\u2026\u201d <<" diff --git a/tests/reference/mBuildDocBuild_NWD_Lorem_Ipsum.txt b/tests/reference/mBuildDocBuild_NWD_Lorem_Ipsum.txt index 424c373b..73d5d3d5 100644 --- a/tests/reference/mBuildDocBuild_NWD_Lorem_Ipsum.txt +++ b/tests/reference/mBuildDocBuild_NWD_Lorem_Ipsum.txt @@ -2,6 +2,10 @@ >> **By lipsum.com** << +>> Word Count: [field:allWords] << + +>> Character Count: [field:allChars] << + >> “Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…” << >> “There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…” << diff --git a/tests/reference/mBuildDocBuild_OpenDocument_Lorem_Ipsum.fodt b/tests/reference/mBuildDocBuild_OpenDocument_Lorem_Ipsum.fodt index 34e325b2..6299ba17 100644 --- a/tests/reference/mBuildDocBuild_OpenDocument_Lorem_Ipsum.fodt +++ b/tests/reference/mBuildDocBuild_OpenDocument_Lorem_Ipsum.fodt @@ -1,13 +1,13 @@ - 2024-10-25T19:19:43 - novelWriter/2.6a2 + 2024-10-28T18:27:00 + novelWriter/2.6a3 lipsum.com - 48 - P0DT0H39M34S + 50 + P0DT0H40M48S Lorem Ipsum - 2024-10-25T19:19:43 + 2024-10-28T18:27:00 lipsum.com @@ -151,19 +151,21 @@ - - - + + + - - + + - - + + Lorem Ipsum By lipsum.com + Word Count: 0 + Character Count: 0 “Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…” “There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…” Comment: Exctracted from the lipsum.com website. diff --git a/tests/reference/mBuildDocBuild_Standard_Markdown_Lorem_Ipsum.md b/tests/reference/mBuildDocBuild_Standard_Markdown_Lorem_Ipsum.md index 925a15c5..a9627afd 100644 --- a/tests/reference/mBuildDocBuild_Standard_Markdown_Lorem_Ipsum.md +++ b/tests/reference/mBuildDocBuild_Standard_Markdown_Lorem_Ipsum.md @@ -2,6 +2,10 @@ **By lipsum.com** +Word Count: 4,169 + +Character Count: 27,898 + “Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…” “There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…” diff --git a/tests/test_gui/test_gui_doceditor.py b/tests/test_gui/test_gui_doceditor.py index 2e0cac3f..3910e7b1 100644 --- a/tests/test_gui/test_gui_doceditor.py +++ b/tests/test_gui/test_gui_doceditor.py @@ -2167,15 +2167,15 @@ def testGuiEditor_Search(qtbot, monkeypatch, nwGUI, prjLipsum): docEditor._lastFind = None docEditor.replaceNext() assert docEditor.textCursor().selectedText() == "a" - assert docEditor.getCursorPosition() == 92 + assert docEditor.getCursorPosition() == 83 # Iterate through the rest - finds = [104, 123, 175, 197, 206, 211, 220, 238, 250, 250] - for i in range(10): + finds = [85, 105, 110, 141, 169, 181, 200, 252, 274, 283, 288, 297] + for i in range(len(finds)): docEditor.replaceNext() assert docEditor.textCursor().selectedText() == "a" assert docEditor.getCursorPosition() == finds[i] - assert docEditor._lastFind == (249, 250) + assert docEditor._lastFind == (296, 297) # Search for something that doesn't exist docSearch.searchBox.setText("x") diff --git a/tests/test_gui/test_gui_outline.py b/tests/test_gui/test_gui_outline.py index 4f53eef7..3dc6b32b 100644 --- a/tests/test_gui/test_gui_outline.py +++ b/tests/test_gui/test_gui_outline.py @@ -241,9 +241,9 @@ def testGuiOutline_Content(qtbot, monkeypatch, nwGUI, prjLipsum, fncPath, tstPat assert outlineData.fileValue.text() == "Lorem Ipsum" assert outlineData.itemValue.text() == "Finished" - assert outlineData.cCValue.text() == "230" - assert outlineData.wCValue.text() == "40" - assert outlineData.pCValue.text() == "3" + assert outlineData.cCValue.text() == "259" + assert outlineData.wCValue.text() == "44" + assert outlineData.pCValue.text() == "5" # Scene One selItem = outlineTree.topLevelItem(4) diff --git a/tests/test_tools/test_tools_noveldetails.py b/tests/test_tools/test_tools_noveldetails.py index c15b43bb..98cbf22e 100644 --- a/tests/test_tools/test_tools_noveldetails.py +++ b/tests/test_tools/test_tools_noveldetails.py @@ -60,15 +60,15 @@ def testToolNovelDetails_Main(qtbot, nwGUI, prjLipsum, ipsumText): # Check project data assert overview.projName.text() == "Lorem Ipsum" - assert overview.projWords.text() == f"{4378:n}" - assert overview.projNovels.text() == f"{3640:n}" + assert overview.projWords.text() == f"{4382:n}" + assert overview.projNovels.text() == f"{3644:n}" assert overview.projNotes.text() == f"{738:n}" assert overview.projRevisions.text() != "" assert overview.projEditTime.text() != "" # Check novel data for "Novel" assert overview.novelName.text() == "Novel" - assert overview.novelWords.text() == f"{3002:n}" + assert overview.novelWords.text() == f"{3006:n}" assert overview.novelChapters.text() == f"{3:n}" assert overview.novelScenes.text() == f"{5:n}" @@ -87,7 +87,7 @@ def testToolNovelDetails_Main(qtbot, nwGUI, prjLipsum, ipsumText): contents = details.contentsPage # Check defaults - words = [f"{v:n}" for v in [40, 176, 94, 6, 1071, 1615, 0]] + words = [f"{v:n}" for v in [44, 176, 94, 6, 1071, 1615, 0]] pages = [f"{v:n}" for v in [2, 2, 2, 2, 4, 6, 0]] page = [f"{v:n}" for v in [1, 3, 5, 7, 9, 13, 19]] for i in range(6): @@ -100,7 +100,7 @@ def testToolNovelDetails_Main(qtbot, nwGUI, prjLipsum, ipsumText): # Change Settings contents.poValue.setValue(7) contents.wpValue.setValue(50) - words = [f"{v:n}" for v in [40, 176, 94, 6, 1071, 1615, 0]] + words = [f"{v:n}" for v in [44, 176, 94, 6, 1071, 1615, 0]] pages = [f"{v:n}" for v in [2, 4, 2, 2, 22, 34, 0]] page = ["i", "iii"] + [f"{v:n}" for v in [1, 3, 5, 27, 61]] for i in range(6): @@ -114,7 +114,7 @@ def testToolNovelDetails_Main(qtbot, nwGUI, prjLipsum, ipsumText): contents.dblValue.setChecked(False) contents.poValue.setValue(0) contents.wpValue.setValue(100) - words = [f"{v:n}" for v in [40, 176, 94, 6, 1071, 1615, 0]] + words = [f"{v:n}" for v in [44, 176, 94, 6, 1071, 1615, 0]] pages = [f"{v:n}" for v in [1, 2, 1, 1, 11, 17, 0]] page = [f"{v:n}" for v in [1, 2, 4, 5, 6, 17, 34]] for i in range(6):