Skip to content

Commit

Permalink
Fix attr panic test (#222)
Browse files Browse the repository at this point in the history
It didn't actually work the way it was written.
  • Loading branch information
markuswustenberg authored Oct 9, 2024
1 parent 52357fc commit f316a0a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions gomponents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,12 @@ func TestAttr(t *testing.T) {
})

t.Run("panics with more than two arguments", func(t *testing.T) {
called := false
defer func() {
if err := recover(); err != nil {
called = true
if rec := recover(); rec == nil {
t.FailNow()
}
}()
g.Attr("name", "value", "what is this?")
if !called {
t.FailNow()
}
})

t.Run("implements fmt.Stringer", func(t *testing.T) {
Expand Down

0 comments on commit f316a0a

Please sign in to comment.