mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-01 01:41:39 +00:00
29 lines
619 B
Go
29 lines
619 B
Go
package yqlib
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/mikefarah/yq/v4/test"
|
|
)
|
|
|
|
var hclFormatScenarios = []formatScenario{
|
|
{
|
|
description: "Simple decode",
|
|
input: `io_mode = "async"`,
|
|
expected: "io_mode: async\n",
|
|
scenarioType: "decode",
|
|
},
|
|
}
|
|
|
|
func testHclScenario(t *testing.T, s formatScenario) {
|
|
if s.scenarioType == "decode" {
|
|
test.AssertResultWithContext(t, s.expected, mustProcessFormatScenario(s, NewHclDecoder(), NewYamlEncoder(ConfiguredYamlPreferences)), s.description)
|
|
}
|
|
}
|
|
|
|
func TestHclFormatScenarios(t *testing.T) {
|
|
for _, tt := range hclFormatScenarios {
|
|
testHclScenario(t, tt)
|
|
}
|
|
}
|