From 71cf5fda3c79a70b781d0a04c1089e60699dfe0a Mon Sep 17 00:00:00 2001 From: rescDev Date: Sun, 25 Jul 2021 09:33:47 +0200 Subject: [PATCH] Update comments and test suites --- modules/files/files_test.go | 4 ++-- modules/terraform/var-file.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/files/files_test.go b/modules/files/files_test.go index 99ac5d4f9..520567479 100644 --- a/modules/files/files_test.go +++ b/modules/files/files_test.go @@ -182,8 +182,8 @@ func TestPathContainsTerraformStateOrVars(t *testing.T) { {"contains tfvars", "./folder/terraform.tfvars", true}, {"contains tfvars.json", "./folder/hello/terraform.tfvars.json", true}, {"contains state", "./folder/hello/helloagain/terraform.tfstate", true}, - {"contains state backup", "./folder/pewpew/terraform.tfstate.backup", true}, - {"does not contain any", "./folder/pewpew/terraform.json", false}, + {"contains state backup", "./folder/hey/terraform.tfstate.backup", true}, + {"does not contain any", "./folder/salut/terraform.json", false}, } for _, tt := range data { diff --git a/modules/terraform/var-file.go b/modules/terraform/var-file.go index 5f7f5bde8..09f3a2d3b 100644 --- a/modules/terraform/var-file.go +++ b/modules/terraform/var-file.go @@ -135,7 +135,7 @@ func GetAllVariablesFromVarFileE(t testing.TestingT, fileName string, out interf return parseAndDecodeVarFile(string(fileContents), fileName, out) } -// parseAndDecodeVarFile uses the HCL2 parser to parse the given varfile string into an HCL file body, and then decode it +// parseAndDecodeVarFile uses the HCL2 parser to parse the given varfile string into an HCL or HCL JSON file body, and then decode it // into a map that maps var names to values. func parseAndDecodeVarFile(fileContents string, filename string, out interface{}) (err error) { // The HCL2 parser and especially cty conversions will panic in many types of errors, so we have to recover from