diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2020-03-29 13:53:00 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2020-03-29 13:53:00 -0600 |
commit | deba26d225c5b321a944439eb6b108117ac3d569 (patch) | |
tree | d88fd67ec1b32da4a29a699aca612232b92683b4 /caddyconfig/caddyfile/formatter_test.go | |
parent | 178ba024fea4db2b91fd159da629f0a8588f119a (diff) |
caddyfile: Minor fixes to the formatter
Diffstat (limited to 'caddyconfig/caddyfile/formatter_test.go')
-rw-r--r-- | caddyconfig/caddyfile/formatter_test.go | 16 |
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 |