From 379d277e2b74e20ece05ec1f8c8beb8659993a47 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Sat, 3 Nov 2018 19:49:14 +0000 Subject: [PATCH] hcl/hclsyntax: Fix invalid block parsing test Invalid blocks now have empty bodies rather than nil bodies, to avoid the need to callers to specially handle nils here when they are doing analysis of a partially-invalid file. --- hcl/hclsyntax/parser_test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hcl/hclsyntax/parser_test.go b/hcl/hclsyntax/parser_test.go index 843cde5..f5786ae 100644 --- a/hcl/hclsyntax/parser_test.go +++ b/hcl/hclsyntax/parser_test.go @@ -297,7 +297,16 @@ block "valid" {} &Block{ Type: "block", Labels: []string{"invalid"}, - Body: nil, + Body: &Body{ + SrcRange: hcl.Range{ + Start: hcl.Pos{Line: 2, Column: 1, Byte: 1}, + End: hcl.Pos{Line: 2, Column: 6, Byte: 6}, + }, + EndRange: hcl.Range{ + Start: hcl.Pos{Line: 2, Column: 1, Byte: 1}, + End: hcl.Pos{Line: 2, Column: 6, Byte: 6}, + }, + }, TypeRange: hcl.Range{ Start: hcl.Pos{Line: 2, Column: 1, Byte: 1},