mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-26 10:17:09 +01:00
32 lines
611 B
Go
32 lines
611 B
Go
package metadata_test
|
|
|
|
import (
|
|
"io/fs"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/djherbis/times"
|
|
//_ "github.com/mattn/go-sqlite3"
|
|
"github.com/navidrome/navidrome/log"
|
|
"github.com/navidrome/navidrome/tests"
|
|
. "github.com/onsi/ginkgo/v2"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
func TestMetadata(t *testing.T) {
|
|
tests.Init(t, true)
|
|
log.SetLevel(log.LevelFatal)
|
|
RegisterFailHandler(Fail)
|
|
RunSpecs(t, "Metadata Suite")
|
|
}
|
|
|
|
type testFileInfo struct {
|
|
fs.FileInfo
|
|
}
|
|
|
|
func (t testFileInfo) BirthTime() time.Time {
|
|
if ts := times.Get(t.FileInfo); ts.HasBirthTime() {
|
|
return ts.BirthTime()
|
|
}
|
|
return t.FileInfo.ModTime()
|
|
}
|