MCPcopy Index your code
hub / github.com/git-bug/git-bug / assertEqualEntities

Function assertEqualEntities

entity/dag/entity_test.go:52–70  ·  view source on GitHub ↗
(t *testing.T, a, b *Entity)

Source from the content-addressed store, hash-verified

50}
51
52func assertEqualEntities(t *testing.T, a, b *Entity) {
53 t.Helper()
54
55 // testify doesn't support comparing functions and systematically fail if they are not nil
56 // so we have to set them to nil temporarily
57
58 backOpUnA := a.Definition.OperationUnmarshaler
59 backOpUnB := b.Definition.OperationUnmarshaler
60
61 a.Definition.OperationUnmarshaler = nil
62 b.Definition.OperationUnmarshaler = nil
63
64 defer func() {
65 a.Definition.OperationUnmarshaler = backOpUnA
66 b.Definition.OperationUnmarshaler = backOpUnB
67 }()
68
69 require.Equal(t, a, b)
70}

Callers 2

TestWriteReadFunction · 0.85

Calls 1

HelperMethod · 0.80

Tested by

no test coverage detected