Skip to content

Consolidate assertPanics test helper into internal/testutil package #90

Description

@I-am-nothing

Problem

`mirrorstack_test.go` defines an `assertPanics(t, fn, msg)` helper. Its docstring claims it consolidates the `recover()` pattern across test files.

In practice the helper is only usable within `package mirrorstack`. Other test packages still inline the same recover pattern:

  • `internal/registry/registry_test.go` — 6 inline `recover()` blocks
  • A few call sites in `mirrorstack_test.go` itself

Fix

Create `internal/testutil/panic.go` exposing `AssertPanics(t *testing.T, fn func(), msgFmt string, args ...any)`. Migrate inline `recover()` blocks. Update or remove the overclaim in the current `assertPanics` docstring.

Effort

~30 minutes. Purely test-code refactor, no behavior change.

Flagged during /simplify on PR #87.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions