mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-17 18:45:03 +03:00
refactor(util): move panel version comparison into a shared package
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.
This commit is contained in:
@@ -33,15 +33,6 @@ func TestIsNewerVersion(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCompareVersionStringsRejectsUnexpectedFormats(t *testing.T) {
|
||||
if _, ok := compareVersionStrings("latest", "2.9.3"); ok {
|
||||
t.Fatal("expected non-semver latest tag to be rejected")
|
||||
}
|
||||
if _, ok := compareVersionStrings("v2.9", "2.9.3"); ok {
|
||||
t.Fatal("expected short version to be rejected")
|
||||
}
|
||||
}
|
||||
|
||||
func TestShellQuote(t *testing.T) {
|
||||
if got := shellQuote("/usr/bin/curl"); got != "'/usr/bin/curl'" {
|
||||
t.Fatalf("unexpected quote result: %s", got)
|
||||
|
||||
Reference in New Issue
Block a user