diff options
Diffstat (limited to 'option/option_test.go')
| -rw-r--r-- | option/option_test.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/option/option_test.go b/option/option_test.go index 43d114e..20782a5 100644 --- a/option/option_test.go +++ b/option/option_test.go @@ -7,6 +7,7 @@ import ( "encoding/json" "fmt" "slices" + "strconv" "testing" "go.xyrillian.de/gg/assert" @@ -74,6 +75,11 @@ func TestIter(t *testing.T) { assert.Equal(t, slices.Collect(Some(42).Iter()), []int{42}) } +func TestMap(t *testing.T) { + assert.Equal(t, None[int]().Map(strconv.Itoa), None[string]()) + assert.Equal(t, Some(42).Map(strconv.Itoa), Some("42")) +} + func TestOr(t *testing.T) { none := None[int]() assert.Equal(t, none.Or(none), None[int]()) |
