From e8e85f5eddff334f05b12c56b6f3e0fa41fdfbd1 Mon Sep 17 00:00:00 2001 From: Paul Tyng Date: Wed, 31 Oct 2018 09:21:11 -0400 Subject: [PATCH 1/2] Add additional comment test cases Some of these fail in HCL1 fmt --- hclwrite/format_test.go | 96 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) 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 @@ -304,6 +304,102 @@ zebra = "striped" # baz 𝒜 = 1 # foo 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 = [ + # ... + ] +} `, }, } From 9928b942bb3a57518a54749cd6142bb475add236 Mon Sep 17 00:00:00 2001 From: Paul Tyng Date: Wed, 31 Oct 2018 12:26:27 -0400 Subject: [PATCH 2/2] Add missing module --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index 764dfa2..95d59fe 100644 --- a/go.mod +++ b/go.mod @@ -12,6 +12,7 @@ require ( github.com/google/go-cmp v0.2.0 github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357 // indirect github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0 + github.com/kr/pretty v0.1.0 github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 github.com/pmezard/go-difflib v1.0.0 // indirect