INNER CODE UNIT · Go
TestGenerate_writeAttrLineV4
cloudflare/cf-terraforming · internal/app/cf-terraforming/cmd/generate_test.go:53
func TestGenerate_writeAttrLineV4(t *testing.T) {
multilineListOfStrings := heredoc.Doc(`
a = ["b", "c", "d"]
`)
multilineBlock := heredoc.Doc(`
a = {
c = "d"
e = "f"
}
`)
tests := map[string]struct {
key string
value interface{}
want string
}{
"value is string": {key: "a", value: "b", want: fmt.Sprintf("a = %q\n", "b")},
"value is int": {key: "a", value: 1, want: "a = 1\n"},
"value is float": {key: "a", value: 1.0, want: "a = 1\n"},