feat: Настройки › Автообновление - clients compare their version with the server's every N and update themselves; the server looks at GitLab every N and, when a newer release is out, offers it to an administrator at login (after the PIN) with «Обновить» and «Отказаться»; the words of a made picture's result are the model's only

This commit is contained in:
redtea committed 2026-10-18 12:33:24 +03:00
1 parent 916a49958b
commit 3d2f886f04
22 files changed
+1074 -7

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
package proto
import "testing"
// A version is newer only when it is a higher dotted number: never for the
// same, an older one, or what is not a version at all.
func TestVersionNewer(t *testing.T) {
for _, c := range []struct {
a, b string
want bool
}{
{"0.2.5", "0.2.4", true},
{"0.2.10", "0.2.9", true},
{"0.3.0", "0.2.99", true},
{"1.0", "0.9.9", true},
{"0.2.4", "0.2.4", false},
{"0.2.3", "0.2.4", false},
{"0.2", "0.2.0", false},
{"v0.2.5", "0.2.4", true},
{"", "0.2.4", false},
{"dev", "0.2.4", false},
{"0.2.5", "dev", false},
{"0.2.5", "", false},
{"0.2.5-rc1", "0.2.4", true},
} {
if got := VersionNewer(c.a, c.b); got != c.want {
t.Errorf("VersionNewer(%q, %q) = %v, want %v", c.a, c.b, got, c.want)
}
}
}