github.com/sandwich-go/boost@v1.3.29/version/version_test.go (about)

     1  package version
     2  
     3  import (
     4  	. "github.com/smartystreets/goconvey/convey"
     5  	"testing"
     6  )
     7  
     8  func TestVersion(t *testing.T) {
     9  	Convey(`version`, t, func() {
    10  		for _, ver := range []struct {
    11  			version  string
    12  			userData string
    13  			valid    bool
    14  			expected string
    15  		}{
    16  			{version: "unknown", valid: false, expected: "unknown_unknown_unknown_unknown_unknown"},
    17  			{version: "1.3.2", valid: true, expected: "1.3.2_unknown_unknown_unknown_unknown"},
    18  			{version: "1.3.2", userData: "__data__", valid: true, expected: "1.3.2_unknown_unknown_unknown_unknown___data__"},
    19  		} {
    20  			Version = ver.version
    21  			UserData = ver.userData
    22  			So(ver.valid, ShouldEqual, Valid())
    23  			So(ver.expected, ShouldEqual, String())
    24  		}
    25  	})
    26  }