diff --git a/internal/backup/archive_test.go b/internal/backup/archive_test.go index 6effe79d..fa8cb1fe 100644 --- a/internal/backup/archive_test.go +++ b/internal/backup/archive_test.go @@ -172,7 +172,11 @@ func TestAFailedWriteFileLeavesNothingBehind(t *testing.T) { func TestFileNamesSortByTimeAndAreRecognised(t *testing.T) { earlier := FileName(time.Date(2026, 1, 9, 23, 0, 0, 0, time.UTC)) - later := FileName(time.Date(2026, 1, 10, 1, 0, 0, 0, time.FixedZone("x", 5*3600))) + // 01:00 at UTC-5 is 06:00 UTC: the name is in UTC, not the clock's zone. + later := FileName(time.Date(2026, 1, 10, 1, 0, 0, 0, time.FixedZone("x", -5*3600))) + if later != "minstrel-20260110T060000Z.tar" { + t.Errorf("name = %s, want it in UTC", later) + } if earlier >= later { t.Errorf("%s does not sort before %s", earlier, later) }