summaryrefslogtreecommitdiff
path: root/caddyconfig/caddyfile/parse_test.go
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2023-04-20 14:43:51 -0400
committerGitHub <noreply@github.com>2023-04-20 18:43:51 +0000
commit53b6fab125f3f2f149d59fcfe13b1e8b1735da56 (patch)
tree242a8e721d7ea6fe5c8dddbd090e08ec74d27da0 /caddyconfig/caddyfile/parse_test.go
parentc6ac350a3b53feb1dfcc24d82421cd20da61a163 (diff)
caddyfile: Stricter parsing, error for brace on new line (#5505)
Diffstat (limited to 'caddyconfig/caddyfile/parse_test.go')
-rw-r--r--caddyconfig/caddyfile/parse_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/caddyconfig/caddyfile/parse_test.go b/caddyconfig/caddyfile/parse_test.go
index ad8683b..bbae785 100644
--- a/caddyconfig/caddyfile/parse_test.go
+++ b/caddyconfig/caddyfile/parse_test.go
@@ -293,6 +293,14 @@ func TestParseOneAndImport(t *testing.T) {
// Unexpected next token after '{' on same line
{`localhost
dir1 { a b }`, true, []string{"localhost"}, []int{}},
+
+ // Unexpected '{' on a new line
+ {`localhost
+ dir1
+ {
+ a b
+ }`, true, []string{"localhost"}, []int{}},
+
// Workaround with quotes
{`localhost
dir1 "{" a b "}"`, false, []string{"localhost"}, []int{5}},