/
githubmirror
/
beego
Обзор
Документация
Войти
/
githubmirror
/
beego
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
core/utils/utils_test.go
36 строк
697 B
Ming Deng
remove pkg directory;
08 окт 2020, 13:29
08 окт 2020, 13:29
14c1b76
Код
Авторство
О чём код?
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") } }