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

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