No files matched your search
@@ -9,21 +9,20 @@ import (
|
||||
|
||||
func BenchmarkScanIncremental(b *testing.B) {
|
||||
m := mockfs.New(b)
|
||||
for i := 0; i < 5; i++ {
|
||||
for i := range 5 {
|
||||
m.AddItemsPrefix(fmt.Sprintf("t-%d", i))
|
||||
}
|
||||
m.ScanAndClean()
|
||||
b.ResetTimer()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
for b.Loop() {
|
||||
m.ScanAndClean()
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkScanFull(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
for b.Loop() {
|
||||
m := mockfs.New(b)
|
||||
for i := 0; i < 5; i++ {
|
||||
for i := range 5 {
|
||||
m.AddItemsPrefix(fmt.Sprintf("t-%d", i))
|
||||
}
|
||||
b.StartTimer()
|
||||
|
||||
@@ -43,7 +43,7 @@ func FuzzScanner(f *testing.F) {
|
||||
})
|
||||
}
|
||||
|
||||
func fuzzStruct(taken int, data []byte, seed int64, dest interface{}) {
|
||||
func fuzzStruct(taken int, data []byte, seed int64, dest any) {
|
||||
if len(data) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -363,7 +363,7 @@ func TestNewAlbumForExistingArtist(t *testing.T) {
|
||||
assert.NoError(t, m.DB().Where("name=?", "artist-2").Find(&artist).Error) // find orig artist
|
||||
assert.Greater(t, artist.ID, 0)
|
||||
|
||||
for tr := 0; tr < 3; tr++ {
|
||||
for tr := range 3 {
|
||||
m.AddTrack(fmt.Sprintf("artist-2/new-album/track-%d.mp3", tr))
|
||||
m.SetTags(fmt.Sprintf("artist-2/new-album/track-%d.mp3", tr), func(tags *mockfs.TagInfo) {
|
||||
tags.RawArtist = "artist-2"
|
||||
@@ -552,7 +552,7 @@ func TestCompilationAlbumWithoutAlbumArtist(t *testing.T) {
|
||||
const toAdd = 5
|
||||
|
||||
// add tracks to one folder with random artists and no album artist tag
|
||||
for i := 0; i < toAdd; i++ {
|
||||
for i := range toAdd {
|
||||
p := fmt.Sprintf("%s/%s/track-%d.flac", pathArtist, pathAlbum, i)
|
||||
m.AddTrack(p)
|
||||
m.SetTags(p, func(tags *mockfs.TagInfo) {
|
||||
@@ -605,7 +605,7 @@ func TestAlbumAndArtistSameNameWeirdness(t *testing.T) {
|
||||
|
||||
const name = "same"
|
||||
|
||||
add := func(path string, a ...interface{}) {
|
||||
add := func(path string, a ...any) {
|
||||
m.AddTrack(fmt.Sprintf(path, a...))
|
||||
m.SetTags(fmt.Sprintf(path, a...), func(tags *mockfs.TagInfo) {})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user