mirror of
https://github.com/hanzoai/beego.git
synced 2026-11-17 13:19:25 +00:00
Faithful fork of upstream beego v1.12.12 with two changes only: - module path github.com/beego/beego -> github.com/hanzoai/beego (all internal imports repointed) - orm sqlite3 test driver mattn/go-sqlite3 -> hanzoai/csqlite (drop-in); drops the bogus 'mattn/go-sqlite3 v2.0.3+incompatible' pin that poisoned every consumer's module graph via beego v1's go.mod. go build ./... green; go list -deps mattn = 0; grep mattn go.mod = 0. Behavior identical to upstream v1.12.12 (no logic changes). Lets ai repoint its beego-v1 web layer by import path only, preserving exact runtime behavior.
37 lines
697 B
Go
37 lines
697 B
Go
package utils
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestCompareGoVersion(t *testing.T) {
|
|
targetVersion := "go1.8"
|
|
if compareGoVersion("go1.12.4", targetVersion) != 1 {
|
|
t.Error("should be 1")
|
|
}
|
|
|
|
if compareGoVersion("go1.8.7", targetVersion) != 1 {
|
|
t.Error("should be 1")
|
|
}
|
|
|
|
if compareGoVersion("go1.8", targetVersion) != 0 {
|
|
t.Error("should be 0")
|
|
}
|
|
|
|
if compareGoVersion("go1.7.6", targetVersion) != -1 {
|
|
t.Error("should be -1")
|
|
}
|
|
|
|
if compareGoVersion("go1.12.1rc1", targetVersion) != 1 {
|
|
t.Error("should be 1")
|
|
}
|
|
|
|
if compareGoVersion("go1.8rc1", targetVersion) != 0 {
|
|
t.Error("should be 0")
|
|
}
|
|
|
|
if compareGoVersion("go1.7rc1", targetVersion) != -1 {
|
|
t.Error("should be -1")
|
|
}
|
|
}
|