Documentation
¶
Overview ¶
Package ehttptest holds the conventions shared by every ehttp test: each assertion carries its basis (a spec section or a reason), and known bugs run as strict expected failures.
Index ¶
Constants ¶
const PendingEnv = "EHTTP_PENDING"
PendingEnv selects the pending mode of KnownBug when it is not empty.
Variables ¶
This section is empty.
Functions ¶
func Eq ¶
func Eq[T comparable](t testing.TB, basis string, got, want T)
Eq fails t when got != want. basis names why the expectation holds, e.g. "RFC 9110 §15.5.6".
func KnownBug ¶
KnownBug runs check for the open defect name. The name is a kebab-case description of the defect, for example "sample-bug". A test that covers two defects joins the names with "+". The check asserts the correct behavior. Use it like this:
ehttptest.KnownBug(t, "sample-bug", func(t testing.TB) {
ehttptest.Eq(t, "RFC 9110 §1", got, want)
})
Default mode: a failure of check fails the test with a message that starts with "pending <name>:". A pass is a pass. This is the TDD view (red until the bug is fixed).
Pending mode (EHTTP_PENDING set): a failure skips the test with the same "pending <name>:" prefix, so a gate can stay green and list the open work. A pass fails the test, so a fixed bug forces its marker to be removed.
Keep setup (ports, fixtures, servers) outside check: in pending mode a Fatal inside check is reported as pending, not as a setup failure.
Types ¶
This section is empty.