test gorush version.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-05-19 22:45:42 +08:00
parent 87320ed011
commit 349099fcf6
2 changed files with 8 additions and 0 deletions

View File

@ -21,7 +21,11 @@ func initTest() {
}
func TestPrintGoRushVersion(t *testing.T) {
SetVersion("3.0.0")
ver := GetVersion()
PrintGoRushVersion()
assert.Equal(t, "3.0.0", ver)
}
func TestRunNormalServer(t *testing.T) {

View File

@ -12,6 +12,10 @@ func SetVersion(ver string) {
version = ver
}
func GetVersion() string {
return version
}
// PrintGoRushVersion provide print server engine
func PrintGoRushVersion() {
fmt.Printf(`GoRush %s, Compiler: %s %s, Copyright (C) 2016 Bo-Yi Wu, Inc.`,