Release 1.4.0: macOS CLI builds and multi-platform update channel.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package update
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCompare(t *testing.T) {
|
||||
if Compare("1.1.0", "1.0.0") <= 0 {
|
||||
@@ -13,3 +16,28 @@ func TestCompare(t *testing.T) {
|
||||
t.Fatal("expected equal")
|
||||
}
|
||||
}
|
||||
|
||||
func TestManifestAssetFor(t *testing.T) {
|
||||
m := Manifest{
|
||||
URL: "https://git.evilfox.cc/legacy.exe",
|
||||
SHA256: "abc",
|
||||
Platforms: map[string]PlatformAsset{
|
||||
"darwin-arm64": {
|
||||
URL: "https://git.evilfox.cc/arm64/Navis",
|
||||
SHA256: "def",
|
||||
},
|
||||
},
|
||||
}
|
||||
u, s, ok := m.AssetFor("darwin-arm64")
|
||||
if !ok || u == "" || s != "def" {
|
||||
t.Fatalf("darwin: %v %q %q", ok, u, s)
|
||||
}
|
||||
u, s, ok = m.AssetFor("windows-amd64")
|
||||
if !ok || !strings.Contains(u, "legacy") || s != "abc" {
|
||||
t.Fatalf("windows legacy: %v %q %q", ok, u, s)
|
||||
}
|
||||
_, _, ok = m.AssetFor("linux-amd64")
|
||||
if ok {
|
||||
t.Fatal("expected missing linux")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user