@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user