MCPcopy Create free account
hub / github.com/aws-cloudformation/rain / TestSetMapValue

Function TestSetMapValue

internal/node/node_test.go:171–181  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

169}
170
171func TestSetMapValue(t *testing.T) {
172 n := &yaml.Node{Kind: yaml.MappingNode, Content: make([]*yaml.Node, 0)}
173 node.SetMapValue(n, "Test", &yaml.Node{Kind: yaml.ScalarNode, Value: "Val"})
174 if len(n.Content) != 2 || n.Content[0].Value != "Test" || n.Content[1].Value != "Val" {
175 t.Errorf("Unexpected length or content, len is %v", len(n.Content))
176 }
177 node.SetMapValue(n, "Test", &yaml.Node{Kind: yaml.ScalarNode, Value: "Val2"})
178 if n.Content[1].Value != "Val2" {
179 t.Errorf("Unexpected value: %v", n.Content[1].Value)
180 }
181}
182
183func TestDiff(t *testing.T) {
184

Callers

nothing calls this directly

Calls 1

SetMapValueFunction · 0.92

Tested by

no test coverage detected