Skip to content

Commit 88e7a26

Browse files
authored
Merge pull request #43 from euanwm/chore/additional_json_test
Added additional JSON test
2 parents 9101989 + dd7f439 commit 88e7a26

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

option/json_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,10 @@ func TestUnmarshalEmpty(t *testing.T) {
6464
assert.Nil(t, err)
6565
assert.True(t, value.MiddleName.IsNone())
6666
}
67+
68+
func TestUnmarshalError(t *testing.T) {
69+
var number option.Option[int]
70+
err := number.UnmarshalJSON([]byte("not a number"))
71+
assert.NotNil(t, err)
72+
assert.True(t, number.IsNone())
73+
}

0 commit comments

Comments
 (0)