github.com/m4gshm/gollections@v0.0.13-0.20240331203319-a34a86e58a24/internal/examples/sliceexamples/slice_Convert_test.go (about)

     1  package sliceexamples
     2  
     3  import (
     4  	"strconv"
     5  	"testing"
     6  
     7  	"github.com/stretchr/testify/assert"
     8  
     9  	"github.com/m4gshm/gollections/slice"
    10  )
    11  
    12  func Test_Convert(t *testing.T) {
    13  
    14  	var s []string = slice.Convert([]int{1, 3, 5, 7, 9, 11}, strconv.Itoa)
    15  	//[]string{"1", "3", "5", "7", "9", "11"}
    16  
    17  	assert.Equal(t, slice.Of("1", "3", "5", "7", "9", "11"), s)
    18  }