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

Function TestVerifyOutput

cft/parse/parse_test.go:146–182  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

144}
145
146func TestVerifyOutput(t *testing.T) {
147 source, err := parse.Map(map[string]interface{}{
148 "foo": map[string]interface{}{
149 "bar": map[string]interface{}{
150 "Fn::GetAtt": []interface{}{
151 "foo",
152 "bar",
153 },
154 },
155 "baz": map[string]interface{}{
156 "Fn::GetAtt": []interface{}{
157 "foo",
158 "bar",
159 },
160 },
161 "quux": []interface{}{
162 "mooz",
163 },
164 },
165 })
166 if err != nil {
167 t.Fatal(err)
168 }
169
170 goodCase := "foo:\n bar: !GetAtt foo.bar\n baz: !GetAtt\n - foo\n - bar\n quux:\n - mooz"
171 badCase := "foo:\n bar: baz\n quux: mooz"
172
173 err = parse.Verify(source, goodCase)
174 if err != nil {
175 t.Error(err)
176 }
177
178 err = parse.Verify(source, badCase)
179 if err == nil {
180 t.Errorf("Verify did not pick up a difference!")
181 }
182}
183
184func TestEmptySub(t *testing.T) {
185 expected, err := parse.Map(map[string]interface{}{

Callers

nothing calls this directly

Calls 2

MapFunction · 0.92
VerifyFunction · 0.92

Tested by

no test coverage detected