Add server components
build-winui / winui (push) Has been cancelled

This commit is contained in:
QWQLwToo
2026-06-26 13:28:09 +08:00
parent 7ecc6a8923
commit 079ee4eaeb
168 changed files with 37475 additions and 0 deletions
@@ -0,0 +1,31 @@
package releases
import "testing"
func TestCompareVersion(t *testing.T) {
cases := []struct {
a string
b string
want int
}{
{"2.0.6.31", "2.0.6.2", 1},
{"2.0.10", "2.0.9", 1},
{"2.0.6.2", "2.0.6.31", -1},
{"2.0.6", "2.0.6.0", 0},
}
for _, tc := range cases {
if got := compareVersion(tc.a, tc.b); got != tc.want {
t.Fatalf("compareVersion(%q, %q) = %d, want %d", tc.a, tc.b, got, tc.want)
}
}
}
func TestDetectPackageMetadata(t *testing.T) {
platform, arch := detectPlatform("YMhutBox_2.0.6.31_x64.msix")
if platform != "windows" || arch != "x64" {
t.Fatalf("detectPlatform returned %s/%s", platform, arch)
}
if version := detectVersion("YMhut_Box_WinUI_Setup_2.0.6.31.exe"); version != "2.0.6.31" {
t.Fatalf("detectVersion returned %q", version)
}
}