# Functions
AssertGoldenFile checks that a "golden file" matches the expected contents.
BeginAll begins a transaction in each of the underlying connections.
CreateTestDatabase creates a randomized test database.
DefaultDB returns a default database connection for tests.
DefaultDBs returns a default set database connections for tests.
DropTestDatabase drops a database.
GetTestFixture opens a file in the test fixtures directory.
MarkUpdateGoldenFlag is intended to be used in a `TestMain()` to declare a flag **before** `go test` parses flags (if not, unknown flags will fail a test).
New returns a new test suite.
NewFixtureConfig returns a new `FixtureConfig` and applies options.
NowRounded returns the current time, but rounded to a given precision and then placed into a timezone given by a location name from the IANA Time Zone database (or "Local").
OptAfter appends after run actions.
OptBefore appends before run actions.
OptLog sets the suite logger.
OptTestFixtureDirectory sets the directory used to look up test fixture files.
OptUpdateGoldenFlag sets the default flag used to determine if golden files should be updated (e.g.
OptWithDefaultDB runs a test suite with a dedicated database connection.
OptWithDefaultDBs runs a test suite with a count of database connections.
OptWithStatementLabelRequired adds a defaultdb interceptor that enforces that statement labels must be present on all statements.
ResolveDBConfig is intended to be used to help debug issues resolving a `db.Config` from the environment.
RollbackAll calls `Rollback` on a set of transactions.
ValidatePool validates that - the connection string is valid - the selected `sql` driver can be used - a simple ping can be sent over the connection (is the DB reachable?)
In the case of failure, this tries to diagnose the connection error and produce helpful tips on how to resolve.
# Constants
DefaultFixtureDirectory is the default directory where test fixture files will be retrieved.
DefaultGoldenFilePrefix is the prefix that will be prepended to suffixes for golden filenames.
DefaultUpdateGoldenFlag is the flag that this package will use to check if golden files should be updated.
FailureCodes.
FailureCodes.
FailureCodes.
# Structs
AlwaysFailDB implements the `db.DB` interface, but each method always fails.
FixtureConfig represents defaults used for working with test fixtures.
PseudoQueryDB implements the `db.DB` interface, it intercepts calls to `QueryContext` and replaces the `query` / `args` arguments with custom values.
SingleError satisfies ErrorProducer for a single error.
SliceErrors satisfies ErrorProducer for a slice of errors.
Suite is a set of before and after actions for a given package tests.
# Interfaces
ErrorProducer is an interface that defines an error factory.
# Type aliases
FixtureOption is a mutator for a `FixtureConfig`.
Option is a mutator for a test suite.
SuiteAction is a step that can be run either before or after package tests.