github.com/sandwich-go/boost@v1.3.29/xstrings/xstrings_test.go (about)

     1  package xstrings
     2  
     3  import (
     4  	. "github.com/smartystreets/goconvey/convey"
     5  	"testing"
     6  )
     7  
     8  func TestString(t *testing.T) {
     9  	Convey("string", t, func() {
    10  		So(FirstUpper("abc"), ShouldEqual, `Abc`)
    11  		So(FirstUpper("_abc"), ShouldEqual, `_abc`)
    12  		So(FirstLower("Abc"), ShouldEqual, `abc`)
    13  		So(FirstLower("_abc"), ShouldEqual, `_abc`)
    14  		So(HasPrefixIgnoreCase("abc", "AB"), ShouldBeTrue)
    15  		So(HasPrefixIgnoreCase("abc", "ac"), ShouldBeFalse)
    16  		So(TrimPrefixIgnoreCase("abc", "AB"), ShouldEqual, "c")
    17  	})
    18  }