package
0.32.1
Repository: https://github.com/adguardteam/golibs.git
Documentation: pkg.go.dev

# Packages

Package fakefs contains fake implementations of interfaces from package io/fs from the standard library.
Package fakeio contains fake implementations of interfaces from package io from the standard library.
Package fakenet contains fake implementations of interfaces from package net from the standard library.
Package fakeservice contains fake implementations of interfaces from package service.
Package faketime contains fake implementations of interfaces from package timeutil.
Package sentrytest contains fake implementations of interfaces for the Sentry module.

# Functions

AssertErrorMsg asserts that the error is not nil and that its message is equal to msg.
AssertMarshalText checks that the implementation of [encoding.TextMarshaler.MarshalText] works in all situations and results in the string s.
AssertUnmarshalText checks that the implementation of [encoding.TextUnmarshaler.UnmarshalText] works in all situations and results in a value deeply equal to want.
CleanupAndRequireSuccess sets a cleanup function which checks the error returned by f and fails the test using tb if there is one.
ContextWithTimeout is a helper that creates a new context with timeout and registers ctx's cancellation with [testing.TB.Cleanup].
DiscardLogOutput runs tests with discarded logger output.
RequireReceive waits until res is received from ch or until the timeout is exceeded.
RequireSend waits until v is sent to ch or until the timeout is exceeded.
RequireTypeAssert is a helper that first requires the desired type and then, if the type is correct, converts and returns the value.

# Structs

PanicT can be used with the helpers from package require in cases when testing.T and similar standard test helpers aren't safe for use, e.g.