MCPcopy Index your code
hub / github.com/riverqueue/river / TestMap

Function TestMap

rivershared/util/sliceutil/slice_util_test.go:78–92  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

76}
77
78func TestMap(t *testing.T) {
79 t.Parallel()
80
81 result1 := Map([]int{1, 2, 3, 4}, func(x int) string {
82 return "Hello"
83 })
84 result2 := Map([]int64{1, 2, 3, 4}, func(x int64) string {
85 return strconv.FormatInt(x, 10)
86 })
87
88 require.Len(t, result1, 4)
89 require.Len(t, result2, 4)
90 require.Equal(t, []string{"Hello", "Hello", "Hello", "Hello"}, result1)
91 require.Equal(t, []string{"1", "2", "3", "4"}, result2)
92}
93
94func TestMapError(t *testing.T) {
95 t.Parallel()

Callers

nothing calls this directly

Calls 1

MapFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…