Documentation
¶
Overview ¶
Package testutil holds the small assertions and waits shared across otherwise independent tests. It sits below every production package so tests share mechanics without importing another domain.
Index ¶
- func Check(t testing.TB, err error)
- func Database(t testing.TB) string
- func Equal[T comparable](t testing.TB, got, want T, what string)
- func Eventually(t testing.TB, timeout time.Duration, what string, ready func() bool)
- func RemainsBlocked[T any](t testing.TB, done <-chan T, what string)
- func Serve(handler http.Handler, request *http.Request) *httptest.ResponseRecorder
- func WaitForFile(t testing.TB, path string)
- func Within(t testing.TB, done <-chan error, timeout time.Duration, what string)
- func WriteScript(t testing.TB, path, body string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Database ¶
Database gives t an empty schema of its own in the Postgres server CS_TEST_DATABASE_URL names, and returns a URL whose search_path selects it. The schema is dropped when t ends. Without the variable, t is skipped.
func Eventually ¶
func WaitForFile ¶
func WriteScript ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.