github.com/sandwich-go/boost@v1.3.29/xcmd/cmd_slice_test.go (about)

     1  package xcmd
     2  
     3  import (
     4  	. "github.com/smartystreets/goconvey/convey"
     5  	"strings"
     6  	"testing"
     7  )
     8  
     9  func TestCmdSlice(t *testing.T) {
    10  	Convey("cmd slice", t, func() {
    11  		for _, cmd := range []struct {
    12  			s        string
    13  			expected string
    14  		}{
    15  			{s: "", expected: ""},
    16  			{s: "hi, hello world", expected: "hi hello world"},
    17  		} {
    18  			So(strings.Join(Slice(cmd.s), ""), ShouldEqual, cmd.expected)
    19  		}
    20  	})
    21  }