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

Function TestCompare

cft/diff/diff_test.go:119–176  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

117}
118
119func TestCompare(t *testing.T) {
120 original := map[string]interface{}{
121 "foo": []interface{}{
122 map[string]interface{}{
123 "foo": "bar",
124 "baz": []interface{}{
125 "foo",
126 "bar",
127 },
128 },
129 "foo",
130 },
131 }
132
133 testCompare(t, []compareTest{
134 {
135 original,
136 original,
137 "(=)map[foo:(=)[(=)map[baz:(=)[(=)foo (=)bar] foo:(=)bar] (=)foo]]",
138 Unchanged,
139 },
140 {
141 original,
142 map[string]interface{}{
143 "foo": []interface{}{
144 map[string]interface{}{
145 "foo": "bar",
146 "baz": []interface{}{
147 "foo",
148 "bar",
149 "baz",
150 },
151 "quux": "mooz",
152 },
153 "foo",
154 "bar",
155 },
156 "bar": "baz",
157 },
158 "(|)map[bar:(+)baz foo:(|)[(|)map[baz:(|)[(=)foo (=)bar (+)baz] foo:(=)bar quux:(+)mooz] (=)foo (+)bar]]",
159 Involved,
160 },
161 {
162 original,
163 map[string]interface{}{
164 "foo": []interface{}{
165 map[string]interface{}{
166 "baz": []interface{}{
167 "foo",
168 },
169 },
170 },
171 },
172 "(|)map[foo:(|)[(|)map[baz:(|)[(=)foo (-)bar] foo:(-)bar] (-)foo]]",
173 Involved,
174 },
175 })
176}

Callers

nothing calls this directly

Calls 1

testCompareFunction · 0.85

Tested by

no test coverage detected