summaryrefslogtreecommitdiff
path: root/caddyconfig/caddyfile/formatter_test.go
diff options
context:
space:
mode:
authorVaibhav <vrongmeal@gmail.com>2020-03-01 01:53:08 +0530
committerGitHub <noreply@github.com>2020-02-29 13:23:08 -0700
commit71e81d262bc34545f73f1380bc5d078d83d1570f (patch)
treede3a155bea038d43e6b1e770a7cfb955aac90347 /caddyconfig/caddyfile/formatter_test.go
parent5fe69ac4ab8bb1da84fc80776548fcc16f89b1db (diff)
fmt: Add support for block nesting. (#3105)
Previously the formatter did not include support for blocks inside other blocks. Hence the formatter could not indent some files properly. This fixes it. Fixes #3104 Signed-off-by: Vaibhav <vrongmeal@gmail.com>
Diffstat (limited to 'caddyconfig/caddyfile/formatter_test.go')
-rw-r--r--caddyconfig/caddyfile/formatter_test.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/caddyconfig/caddyfile/formatter_test.go b/caddyconfig/caddyfile/formatter_test.go
index a78ec7c..76eca00 100644
--- a/caddyconfig/caddyfile/formatter_test.go
+++ b/caddyconfig/caddyfile/formatter_test.go
@@ -29,6 +29,22 @@ b
e { f
}
+
+g {
+h {
+i
+}
+}
+
+j { k {
+l
+}
+}
+
+m {
+ n { o
+ }
+}
`)
expected := []byte(`
a
@@ -41,6 +57,24 @@ c {
e {
f
}
+
+g {
+ h {
+ i
+ }
+}
+
+j {
+ k {
+ l
+ }
+}
+
+m {
+ n {
+ o
+ }
+}
`)
testFormat(t, input, expected)
}