MCPcopy Create free account
hub / github.com/go-task/task / TestConvertIntToString

Function TestConvertIntToString

internal/slicesext/slicesext_test.go:9–24  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestConvertIntToString(t *testing.T) {
10 t.Parallel()
11 input := []int{1, 2, 3, 4, 5}
12 expected := []string{"1", "2", "3", "4", "5"}
13 result := Convert(input, strconv.Itoa)
14
15 if len(result) != len(expected) {
16 t.Errorf("Expected length %d, got %d", len(expected), len(result))
17 }
18
19 for i := range expected {
20 if result[i] != expected[i] {
21 t.Errorf("At index %d: expected %v, got %v", i, expected[i], result[i])
22 }
23 }
24}
25
26func TestConvertStringToInt(t *testing.T) {
27 t.Parallel()

Callers

nothing calls this directly

Calls 1

ConvertFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…