mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-05 04:56:37 +08:00
fix system update current version display
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -152,3 +153,21 @@ func TestSystemUpdateOutputDetailsKeepsTail(t *testing.T) {
|
||||
t.Fatalf("details length = %d, want 12", len(got))
|
||||
}
|
||||
}
|
||||
|
||||
func TestSystemUpdateStatusIncludesCurrentVersion(t *testing.T) {
|
||||
svc := NewSystemUpdateService(nil, nil, nil, nil, "MediaStationGo-v0.0.99")
|
||||
|
||||
status := svc.Status(context.Background())
|
||||
if status.CurrentVersion != "MediaStationGo-v0.0.99" {
|
||||
t.Fatalf("current_version = %q, want MediaStationGo-v0.0.99", status.CurrentVersion)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSystemUpdateStatusDefaultsCurrentVersion(t *testing.T) {
|
||||
svc := NewSystemUpdateService(nil, nil, nil, nil, "")
|
||||
|
||||
status := svc.Status(context.Background())
|
||||
if status.CurrentVersion != "dev" {
|
||||
t.Fatalf("current_version = %q, want dev", status.CurrentVersion)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user