Documentation
¶
Index ¶
- func AssertEquals[T comparable](t *testing.T, expected T, actual T)
- func AssertFailureWithCode(t *testing.T, err error, expectedCode int)
- func AssertSuccess(t *testing.T, result interface{})
- func NewSilentLogger() *log.Logger
- func RandomDataAndDigest(size int64) ([]byte, pb.Digest)
- func RandomDataAndHash(size int64) ([]byte, string)
- func TempDir(t *testing.T) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertEquals ¶ added in v2.6.0
func AssertEquals[T comparable](t *testing.T, expected T, actual T)
AssertEquals fails the test if expected and actual values are not equal. It works with any comparable type.
func AssertFailureWithCode ¶ added in v2.6.0
AssertFailureWithCode asserts that the provided error is a *cache.Error with the expected code.
func AssertSuccess ¶ added in v2.6.0
AssertSuccess asserts that the provided result represents a successful outcome.
The success criteria are: - nil value (e.g., no error) - true boolean
The failure criteria are: - non-nil error - false boolean
func NewSilentLogger ¶
NewSilentLogger returns a cheap logger that doesn't print anything, useful for tests.
func RandomDataAndHash ¶
RandomDataAndHash creates a random blob of the specified size, and returns that blob along with its sha256 hash.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.