Fixed processing of block labels

This commit is contained in:
Mike Farah
2025-12-08 20:30:47 +11:00
parent 6270c29f54
commit 5f3dcb1ccf
2 changed files with 39 additions and 1 deletions
+6
View File
@@ -139,6 +139,12 @@ var hclFormatScenarios = []formatScenario{
expected: "resource:\n aws_instance:\n example:\n ami: \"ami-12345\"\n",
scenarioType: "decode",
},
{
description: "block with labels roundtrip",
input: `resource "aws_instance" "example" { ami = "ami-12345" }`,
expected: "resource \"aws_instance\" \"example\" {\n ami = \"ami-12345\"\n}\n",
scenarioType: "roundtrip",
},
{
description: "roundtrip simple attribute",
input: `io_mode = "async"`,