summaryrefslogtreecommitdiff
path: root/hclwrite
diff options
context:
space:
mode:
authorPaul Tyng <paul@paultyng.net>2018-10-31 09:21:11 -0400
committerPaul Tyng <paul@paultyng.net>2018-10-31 12:25:12 -0400
commite8e85f5eddff334f05b12c56b6f3e0fa41fdfbd1 (patch)
treea5064735fc157bba6444b18622b0a1920081d766 /hclwrite
parent3e4b7e0eb20ecc20e70dbd458f7a54daf0032830 (diff)
Add additional comment test cases
Some of these fail in HCL1 fmt
Diffstat (limited to 'hclwrite')
-rw-r--r--hclwrite/format_test.go96
1 files changed, 96 insertions, 0 deletions
diff --git a/hclwrite/format_test.go b/hclwrite/format_test.go
index 38b1089..f31a224 100644
--- a/hclwrite/format_test.go
+++ b/hclwrite/format_test.go
@@ -306,6 +306,102 @@ bungle = "🇬🇧" # baz
zebra = "striped" # baz
`,
},
+ {
+ `
+foo {
+# ...
+}
+`,
+ `
+foo {
+ # ...
+}
+`,
+ },
+ {
+ `
+foo = {
+# ...
+}
+`,
+ `
+foo = {
+ # ...
+}
+`,
+ },
+ {
+ `
+foo = [
+# ...
+]
+`,
+ `
+foo = [
+ # ...
+]
+`,
+ },
+ {
+ `
+foo = [{
+# ...
+}]
+`,
+ `
+foo = [{
+ # ...
+}]
+`,
+ },
+ {
+ `
+foo {
+bar {
+# ...
+}
+}
+`,
+ `
+foo {
+ bar {
+ # ...
+ }
+}
+`,
+ },
+ {
+ `
+foo {
+bar = {
+# ...
+}
+}
+`,
+ `
+foo {
+ bar = {
+ # ...
+ }
+}
+`,
+ },
+ {
+ `
+foo {
+bar = [
+# ...
+]
+}
+`,
+ `
+foo {
+ bar = [
+ # ...
+ ]
+}
+`,
+ },
}
for i, test := range tests {