Esempio n. 1
0
func TestMerge(t *testing.T) {
	for k, c := range [][]map[string]interface{}{
		[]map[string]interface{}{
			map[string]interface{}{"foo": "bar"},
			map[string]interface{}{"baz": "bar"},
			map[string]interface{}{"foo": "bar", "baz": "bar"},
		},
		[]map[string]interface{}{
			map[string]interface{}{"foo": "bar"},
			map[string]interface{}{"foo": "baz"},
			map[string]interface{}{"foo": "bar"},
		},
		[]map[string]interface{}{
			map[string]interface{}{},
			map[string]interface{}{"foo": "baz"},
			map[string]interface{}{"foo": "baz"},
		},
		[]map[string]interface{}{
			map[string]interface{}{"foo": "bar"},
			map[string]interface{}{"foo": "baz", "bar": "baz"},
			map[string]interface{}{"foo": "bar", "bar": "baz"},
		},
	} {
		assert.EqualValues(t, c[2], merge(c[0], c[1]), "Case %d", k)
	}
}
Esempio n. 2
0
// EqualValues asserts that two objects are equal or convertable to each other.
//
//    require.EqualValues(t, uint32(123), int32(123), "123 and 123 should be equal")
func EqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) {
	if !assert.EqualValues(t, expected, actual, msgAndArgs...) {
		t.FailNow()
	}
}