summaryrefslogtreecommitdiff
path: root/caddyconfig/caddyfile/formatter_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'caddyconfig/caddyfile/formatter_test.go')
-rw-r--r--caddyconfig/caddyfile/formatter_test.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/caddyconfig/caddyfile/formatter_test.go b/caddyconfig/caddyfile/formatter_test.go
index 8f2a012..25bd7fa 100644
--- a/caddyconfig/caddyfile/formatter_test.go
+++ b/caddyconfig/caddyfile/formatter_test.go
@@ -287,10 +287,24 @@ bar "{\"key\":34}"`,
expect: `foo \"literal\"`,
},
{
- description: "simple placeholders",
+ description: "simple placeholders as standalone tokens",
input: `foo {bar}`,
expect: `foo {bar}`,
},
+ {
+ description: "simple placeholders within tokens",
+ input: `foo{bar} foo{bar}baz`,
+ expect: `foo{bar} foo{bar}baz`,
+ },
+ {
+ description: "placeholders and malformed braces",
+ input: `foo{bar} foo{ bar}baz`,
+ expect: `foo{bar} foo {
+ bar
+}
+
+baz`,
+ },
} {
// the formatter should output a trailing newline,
// even if the tests aren't written to expect that