Add backup dashboard and appearance settings
This commit is contained in:
15
backups_test.go
Normal file
15
backups_test.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package main
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestLatestBackups(t *testing.T) {
|
||||
items := []BackupItem{
|
||||
{VMID: 100, CreatedAt: 10, Storage: "old"},
|
||||
{VMID: 100, CreatedAt: 20, Storage: "new"},
|
||||
{VMID: 101, CreatedAt: 15, Storage: "only"},
|
||||
}
|
||||
latest := latestBackups(items)
|
||||
if len(latest) != 2 || latest[0].Storage != "new" {
|
||||
t.Fatalf("неожиданный список последних копий: %+v", latest)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user