diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2026-08-18 11:30:54 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2026-08-18 11:30:54 +0200 |
| commit | 50ba9cfb04e257fafa3fdd566f9f70a1986339e8 (patch) | |
| tree | b4601a46bd2c9b90297e8055bec7d60afc07cdb1 /pathrouter/pathrouter_test.go | |
| parent | 22e8f3548a72c78deccedc5a65c1cba029f52e6d (diff) | |
| download | go-gg-50ba9cfb04e257fafa3fdd566f9f70a1986339e8.tar.gz | |
assert: add Panics, PanicsWith
I want to use this for test coverage in microprom.
This turned out to be a bigger change than expected because testcapture
has a dependency on assert, which I had to invert to be able to use
testcapture.Capture() in assert.
Diffstat (limited to 'pathrouter/pathrouter_test.go')
| -rw-r--r-- | pathrouter/pathrouter_test.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/pathrouter/pathrouter_test.go b/pathrouter/pathrouter_test.go index 3e91ce9..54108ac 100644 --- a/pathrouter/pathrouter_test.go +++ b/pathrouter/pathrouter_test.go @@ -14,7 +14,6 @@ import ( "go.xyrillian.de/gg/assert" pr "go.xyrillian.de/gg/pathrouter" - "go.xyrillian.de/gg/testcapture" ) func TestRouting(t *testing.T) { @@ -157,11 +156,8 @@ func TestRouting(t *testing.T) { func TestPanics(t *testing.T) { check := func(expected string, action func()) { t.Helper() - result := testcapture.Capture(t.Context(), t.Name(), func(t assert.TestingTB) { action() }) - assert.Equal(t, result, testcapture.Result{ - Outcome: testcapture.OutcomePanicked, - Panic: expected, - }) + actual := assert.PanicsWith[string](t, action) + assert.Equal(t, actual, expected) } check(`matcher within CatchAllVariable() may not accept unlimited path lengths`, func() { |
