aboutsummaryrefslogtreecommitdiffhomepage
path: root/testscripts
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-10-23 19:26:13 +0200
committerBjørn Erik Pedersen <[email protected]>2024-10-24 13:34:11 +0200
commitcb6e27b32a1d09956027b8e45bae0c18c1593d5c (patch)
treebd3031431175596ddfad3a79daf69563f723ac6f /testscripts
parent5bbe95f9c5442898cdfb100bff4f1aac52fce5ad (diff)
downloadhugo-cb6e27b32a1d09956027b8e45bae0c18c1593d5c.tar.gz
hugo-cb6e27b32a1d09956027b8e45bae0c18c1593d5c.zip
hugolib/commands: Fix stuck server error issues
Fixes #11378
Diffstat (limited to 'testscripts')
-rw-r--r--testscripts/commands/server__error_recovery_edit_config.txt42
-rw-r--r--testscripts/commands/server__error_recovery_edit_content.txt42
2 files changed, 84 insertions, 0 deletions
diff --git a/testscripts/commands/server__error_recovery_edit_config.txt b/testscripts/commands/server__error_recovery_edit_config.txt
new file mode 100644
index 000000000..664d99272
--- /dev/null
+++ b/testscripts/commands/server__error_recovery_edit_config.txt
@@ -0,0 +1,42 @@
+# Test the hugo server command when adding an error to a config file
+# and then fixing it.
+
+hugo server &
+
+waitServer
+
+httpget ${HUGOTEST_BASEURL_0}p1/ 'Title: P1'
+
+replace $WORK/hugo.toml 'title =' 'titlefoo'
+httpget ${HUGOTEST_BASEURL_0}p1/ 'failed'
+
+replace $WORK/hugo.toml 'titlefoo' 'title ='
+httpget ${HUGOTEST_BASEURL_0}p1/ 'Title: P1'
+
+stopServer
+
+-- hugo.toml --
+title = "Hugo Server Test"
+baseURL = "https://example.org/"
+disableKinds = ["taxonomy", "term", "sitemap"]
+-- layouts/index.html --
+Title: {{ .Title }}|BaseURL: {{ site.BaseURL }}|
+-- layouts/_default/single.html --
+Title: {{ .Title }}|BaseURL: {{ site.BaseURL }}|
+-- content/_index.md --
+---
+title: Hugo Home
+---
+-- content/p1/index.md --
+---
+title: P1
+---
+-- content/p2/index.md --
+---
+title: P2
+---
+-- static/staticfiles/static.txt --
+static
+
+
+
diff --git a/testscripts/commands/server__error_recovery_edit_content.txt b/testscripts/commands/server__error_recovery_edit_content.txt
new file mode 100644
index 000000000..f5ea7e94b
--- /dev/null
+++ b/testscripts/commands/server__error_recovery_edit_content.txt
@@ -0,0 +1,42 @@
+# Test the hugo server command when adding a front matter error to a content file
+# and then fixing it.
+
+hugo server &
+
+waitServer
+
+httpget ${HUGOTEST_BASEURL_0}p1/ 'Title: P1'
+
+replace $WORK/content/p1/index.md 'title:' 'titlecolon'
+httpget ${HUGOTEST_BASEURL_0}p1/ 'failed'
+
+replace $WORK/content/p1/index.md 'titlecolon' 'title:'
+httpget ${HUGOTEST_BASEURL_0}p1/ 'Title: P1'
+
+stopServer
+
+-- hugo.toml --
+title = "Hugo Server Test"
+baseURL = "https://example.org/"
+disableKinds = ["taxonomy", "term", "sitemap"]
+-- layouts/index.html --
+Title: {{ .Title }}|BaseURL: {{ site.BaseURL }}|
+-- layouts/_default/single.html --
+Title: {{ .Title }}|BaseURL: {{ site.BaseURL }}|
+-- content/_index.md --
+---
+title: Hugo Home
+---
+-- content/p1/index.md --
+---
+title: P1
+---
+-- content/p2/index.md --
+---
+title: P2
+---
+-- static/staticfiles/static.txt --
+static
+
+
+