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

Function testCompare

cft/diff/diff_test.go:15–27  ·  view source on GitHub ↗
(t *testing.T, cases []compareTest)

Source from the content-addressed store, hash-verified

13}
14
15func testCompare(t *testing.T, cases []compareTest) {
16 for _, testCase := range cases {
17 actual := compareValues(testCase.old, testCase.new)
18
19 if actual.Mode() != testCase.mode {
20 t.Errorf("Unexpected mode: '%s' (want '%s')", actual.Mode(), testCase.mode)
21 }
22
23 if !reflect.DeepEqual(actual.String(), testCase.expected) {
24 t.Errorf("%#v\n!=\n%#v", actual.String(), testCase.expected)
25 }
26 }
27}
28
29func TestCompareScalar(t *testing.T) {
30 testCompare(t, []compareTest{

Callers 4

TestCompareScalarFunction · 0.85
TestCompareSlicesFunction · 0.85
TestCompareMapsFunction · 0.85
TestCompareFunction · 0.85

Calls 3

compareValuesFunction · 0.85
ModeMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected