Skip to content

Commit

Permalink
small testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpaulus committed Feb 2, 2024
1 parent 2cafa66 commit c5deb7c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ios/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ type SampleData struct {
FloatValue float64
}

func TestGenericSliceToType(t *testing.T) {
slice := []interface{}{5, 3, 2}
v, err := ios.GenericSliceToType[int](slice)
assert.Nil(t, err)
assert.Equal(t, 3, v[1])
_, err = ios.GenericSliceToType[string](slice)
assert.NotNil(t, err)
}

func TestGetFromMap(t *testing.T) {
m := map[string]interface{}{"s": 3}

Expand Down

0 comments on commit c5deb7c

Please sign in to comment.