feat: add resilient updates and access controls
Container-Image veröffentlichen / container (push) Has been cancelled
Container-Image veröffentlichen / container (push) Has been cancelled
This commit is contained in:
1 parent
a000152423
commit
f02ec9977c
41 files changed
+3277
-151
No files matched your search
@@ -0,0 +1,27 @@
|
||||
package appupdate
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestCompareVersionsUsesStrictStableSemanticVersions(t *testing.T) {
|
||||
t.Parallel()
|
||||
tests := []struct {
|
||||
left string
|
||||
right string
|
||||
want int
|
||||
}{
|
||||
{left: "v1.2.2", right: "v1.2.3", want: -1},
|
||||
{left: "v2.0.0", right: "v1.99.99", want: 1},
|
||||
{left: "v1.2.2", right: "v1.2.2", want: 0},
|
||||
}
|
||||
for _, test := range tests {
|
||||
got, err := compareVersions(test.left, test.right)
|
||||
if err != nil || got != test.want {
|
||||
t.Errorf("compareVersions(%q, %q) = %d, %v; want %d", test.left, test.right, got, err, test.want)
|
||||
}
|
||||
}
|
||||
for _, invalid := range []string{"1.2.3", "v01.2.3", "v1.2", "v1.2.3-rc.1", "v1.2.3+build"} {
|
||||
if validReleaseVersion(invalid) {
|
||||
t.Errorf("invalid release version accepted: %q", invalid)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user