MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / EqualButNotSame

Function EqualButNotSame

testutil/equal_but_not_same.go:13–20  ·  view source on GitHub ↗

EqualButNotSame asserts that expected and actual objects are not the same. It recursively checks all fields to ensure that no pointers are shared. If a pointer, slice or map are nil in either object, the test fails.

(t *testing.T, expected, actual any)

Source from the content-addressed store, hash-verified

11// It recursively checks all fields to ensure that no pointers are shared.
12// If a pointer, slice or map are nil in either object, the test fails.
13func EqualButNotSame(t *testing.T, expected, actual any) {
14 t.Helper()
15
16 expectedVal := reflect.ValueOf(expected)
17 actualVal := reflect.ValueOf(actual)
18
19 deepEqual(t, expectedVal, actualVal, "")
20}
21
22// deepEqual recursively verifies that all values are equal but pointers are different
23// except for the Expires field which is explicitly allowed to be shared

Callers

nothing calls this directly

Calls 1

deepEqualFunction · 0.85

Tested by

no test coverage detected