mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-10-04 13:12:07 +03:00
97bee832f4
The node-assignment path in the service package needs the same MAJOR.MINOR.PATCH comparison the panel updater uses, but service/panel imports service, so the helper cannot stay there.
13 lines
300 B
Go
13 lines
300 B
Go
package version
|
|
|
|
import "testing"
|
|
|
|
func TestCompareRejectsUnexpectedFormats(t *testing.T) {
|
|
if _, ok := Compare("latest", "2.9.3"); ok {
|
|
t.Fatal("expected non-semver latest tag to be rejected")
|
|
}
|
|
if _, ok := Compare("v2.9", "2.9.3"); ok {
|
|
t.Fatal("expected short version to be rejected")
|
|
}
|
|
}
|