AssertEqualWithSanitizedRegex
Sanitizes representations of protobufs in tests and asserts their equality.
def AssertEqualWithSanitizedRegex(
t: *testing.T,
expected: string,
actual: string
) - > null
Asserts that two strings are equal after sanitizing them by removing parts that match a predefined regular expression. This function is used in tests to compare representations of protobufs, ignoring variable parts like memory addresses or timestamps.
Parameters
| Name | Type | Description |
|---|---|---|
| t | *testing.T | The testing context provided by the Go testing framework, used to report test failures. |
| expected | string | The expected string representation of a protobuf, which will be sanitized before comparison. |
| actual | string | The actual string representation of a protobuf, which will be sanitized before comparison. |
Returns
| Type | Description |
|---|---|
null | This function does not return any value; it performs an assertion which will cause the test to fail if the sanitized strings are not equal. |