Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestCase ¶
type TestCase struct { // Protos is a list of protobuf messages that should have the same objecthash. Protos []proto.Message // EquivalentObject is a plain Go object that should have the same objecthash // as the messages under the `protos` field. EquivalentObject interface{} // EquivalentJSONString is a JSON object that should have the same objecthash // as the messages under the `protos` field. EquivalentJSONString string // ExpectedHashString is the expected objecthash for all the objects in the // test case. ExpectedHashString string }
TestCase represents typical ObjectHash-Proto test cases.
func (TestCase) Check ¶
func (tc TestCase) Check(t *testing.T, hasher *ph.ProtoHasher)
Check tests the ObjectHashes for the protos in a TestCase's Protos field.
It does the following checks: - The ObjectHashes of the protos (stringified) are equal to the ExpectedHashString. - The ObjectHashes of the protos are equal to the ObjectHash of the EquivalentJSONString, if present. - The ObjectHashes of the protos are equal to the ObjectHash of the EquivalentObject, if present.
Click to show internal directories.
Click to hide internal directories.