2021-10-04 12:20:16 +10:30
|
|
|
package version
|
2021-06-17 18:47:59 +09:30
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
2022-04-03 20:33:20 +09:30
|
|
|
func TestVersioningUpdate(t *testing.T) {
|
|
|
|
// pretend there is a new version
|
2022-12-05 22:04:40 +10:30
|
|
|
LatestVersion = "v0.13.9"
|
2022-04-03 20:33:20 +09:30
|
|
|
if !UpdateAvailable() {
|
|
|
|
t.Error("should be a version newer than " + CurrentVersion)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestVersioningNoUpdate(t *testing.T) {
|
2022-12-05 23:24:27 +10:30
|
|
|
// pretend there is not a new version
|
2022-04-03 20:33:20 +09:30
|
|
|
LatestVersion = "v0.12.1"
|
|
|
|
if UpdateAvailable() {
|
|
|
|
t.Error("should NOT be a version newer than " + CurrentVersion)
|
2021-06-17 18:47:59 +09:30
|
|
|
}
|
|
|
|
}
|