Skip to content

Commit

Permalink
coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Jul 30, 2024
1 parent 237d0e7 commit 6303253
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pointer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,10 @@ func TestPointer(t *testing.T) {
require.NoError(t, json.Unmarshal([]byte(`{"v":1024}`), &p))
require.Equal(t, 1024, p.Load().V, "UnmarshalJSON should have expected result")
})

t.Run("UnmarshalJSON error", func(t *testing.T) {
var p Pointer[foo]

require.Error(t, json.Unmarshal([]byte(`{"v":true}`), &p), "json.Unmarshal should return an error")
})
}

0 comments on commit 6303253

Please sign in to comment.