增加版本号比较工具
This commit is contained in:
22
tool/version_test.go
Normal file
22
tool/version_test.go
Normal file
@ -0,0 +1,22 @@
|
||||
// Package tool ...
|
||||
//
|
||||
// Description : tool ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2023-12-27 17:51
|
||||
package tool
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test_version_Compare(t *testing.T) {
|
||||
fmt.Println(Version.Compare("2.4.1", "2.4.1.0", true))
|
||||
fmt.Println(Version.Compare("2.4.1", "2.4.1.0", false))
|
||||
fmt.Println(Version.Compare("2.4.0", "2.4.1", true))
|
||||
fmt.Println(Version.Compare("2.4.2", "2.4.1", true))
|
||||
fmt.Println(Version.Compare("2.4", "2.4.1", true))
|
||||
fmt.Println(Version.Compare("2.4.2", "2.4", true))
|
||||
}
|
Reference in New Issue
Block a user