lib/location: Fix regression of timestamp handling (ref #9180) (#9185)

This commit is contained in:
Jakob Borg
2023-10-26 07:41:02 +02:00
committed by GitHub
parent b5082f6af8
commit bae6d5f375
2 changed files with 19 additions and 5 deletions
+10
View File
@@ -9,7 +9,9 @@
package locations
import (
"path/filepath"
"testing"
"time"
"golang.org/x/exp/slices"
)
@@ -100,3 +102,11 @@ func TestUnixDataDir(t *testing.T) {
}
}
}
func TestGetTimestamped(t *testing.T) {
s := getTimestampedAt(PanicLog, time.Date(2023, 10, 25, 21, 47, 0, 0, time.UTC))
exp := "panic-20231025-214700.log"
if file := filepath.Base(s); file != exp {
t.Errorf("got %q, expected %q", file, exp)
}
}