Documentation
¶
Overview ¶
Package testutil holds helpers shared by the core packages' tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SQLiteSchema ¶ added in v0.29.0
SQLiteSchema returns one normalized line per column and per index of tables, read from SQLite's own catalog instead of the statements that created them. Two databases built by different code paths (a store's boot-time CREATE TABLE and its migration) have the same schema when their lines are equal.
func TempDir ¶
TempDir is t.TempDir for directories that hold SQLite files: the directory is removed after the test's later cleanups (database Close included) and the removal is retried for a few seconds.
shortcut: on Windows, Defender and the search indexer briefly open files that were just written; deleting such a file only marks it delete-pending, so removing the directory fails with "directory is not empty" for a few milliseconds. It happens with plain os.WriteFile files too (no handle of ours is open), and testing.T.TempDir retries only access-denied errors. Drop this helper when testing retries ERROR_DIR_NOT_EMPTY.
Types ¶
This section is empty.