github.com/pingcap/br@v5.3.0-alpha.0.20220125034240-ec59c7b6ce30+incompatible/pkg/version/build/info_test.go (about) 1 // Copyright 2021 PingCAP, Inc. Licensed under Apache-2.0. 2 3 package build 4 5 import ( 6 "strings" 7 "testing" 8 9 . "github.com/pingcap/check" 10 ) 11 12 type infoSuite struct{} 13 14 var _ = Suite(&infoSuite{}) 15 16 func TestT(t *testing.T) { 17 TestingT(t) 18 } 19 20 func (*infoSuite) TestInfo(c *C) { 21 info := Info() 22 lines := strings.Split(info, "\n") 23 c.Assert(lines[0], Matches, "Release Version.*") 24 c.Assert(lines[1], Matches, "Git Commit Hash.*") 25 c.Assert(lines[2], Matches, "Git Branch.*") 26 c.Assert(lines[3], Matches, "Go Version.*") 27 c.Assert(lines[4], Matches, "UTC Build Time.*") 28 } 29 30 func (*infoSuite) TestLogInfo(c *C) { 31 LogInfo(BR) 32 LogInfo(Lightning) 33 }