From a65a86ea07ac4fd86b83a748977123aa779321da Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Thu, 3 Dec 2026 20:14:32 -0500 Subject: [PATCH] tests and comments: invented names for real songs and artists the sweep found (#8209) The Title Case sweep of the export found real song titles and artists in fixtures and comments: three songs from one real album, a real song in a release fixture, real artists in a tag test, a link test and a genre test, a real song as a notification example, and a count from a real folder. Each is now invented. Co-Authored-By: Claude Opus 5.5 --- internal/api/admin_library_missing_test.go | 6 +++--- internal/api/admin_suspect_sources.go | 4 ++-- internal/api/admin_suspect_sources_test.go | 4 ++-- internal/catalogue/catalogue_test.go | 4 ++-- internal/library/genre.go | 2 +- internal/library/genre_test.go | 2 +- internal/library/moved_test.go | 4 ++-- internal/library/scanner_test.go | 6 +++--- internal/library/song_link_test.go | 2 +- internal/notifications/render.go | 4 ++-- internal/tagread/tagread_test.go | 4 ++-- web/src/routes/collection/missing/missing.test.ts | 10 +++++----- 12 files changed, 26 insertions(+), 26 deletions(-) diff --git a/internal/api/admin_library_missing_test.go b/internal/api/admin_library_missing_test.go index e8a3da48..5e579520 100644 --- a/internal/api/admin_library_missing_test.go +++ b/internal/api/admin_library_missing_test.go @@ -29,9 +29,9 @@ func TestGroupMissingByDirectory(t *testing.T) { t.Run("consecutive rows in one directory collapse to one group", func(t *testing.T) { groups := groupMissingByDirectory([]dbq.ListMissingTracksRow{ - missingRow("/music/Lincoln Yard/Minutes to Noon", "Given Up", base), - missingRow("/music/Lincoln Yard/Minutes to Noon", "Leave Out All the Rest", base), - missingRow("/music/Lincoln Yard/Minutes to Noon", "Bleed It Out", base), + missingRow("/music/Lincoln Yard/Minutes to Noon", "Paper Wings", base), + missingRow("/music/Lincoln Yard/Minutes to Noon", "Leave the Lights On", base), + missingRow("/music/Lincoln Yard/Minutes to Noon", "Ring It Out", base), }) if len(groups) != 1 { diff --git a/internal/api/admin_suspect_sources.go b/internal/api/admin_suspect_sources.go index d0c9baec..2c7aaecf 100644 --- a/internal/api/admin_suspect_sources.go +++ b/internal/api/admin_suspect_sources.go @@ -39,8 +39,8 @@ type suspectTrackView struct { } // suspectGroupView is a folder's worth of flagged tracks. As on the -// missing-files report, the folder is the unit of decision: Mammalz was 62 rows -// in one folder, which is one problem to look at, not 62. +// missing-files report, the folder is the unit of decision: sixty flagged rows +// in one folder are one problem to look at, not sixty. type suspectGroupView struct { Directory string `json:"directory"` Tracks []suspectTrackView `json:"tracks"` diff --git a/internal/api/admin_suspect_sources_test.go b/internal/api/admin_suspect_sources_test.go index fa509481..aff7d41b 100644 --- a/internal/api/admin_suspect_sources_test.go +++ b/internal/api/admin_suspect_sources_test.go @@ -41,8 +41,8 @@ func TestHandleListSuspectSources_Integration(t *testing.T) { if err := json.Unmarshal(w.Body.Bytes(), &resp); err != nil { t.Fatalf("decode: %v", err) } - // Three present files carry a marker. "Chain Reaction" and "Busted and - // Blue" carry none, and the lyric video's file is missing. + // Three present files carry a marker. "Chain Reaction" and "Bruised and + // Grey" carry none, and the lyric video's file is missing. if resp.Total != 3 { t.Errorf("total = %d, want 3", resp.Total) } diff --git a/internal/catalogue/catalogue_test.go b/internal/catalogue/catalogue_test.go index d1f1107f..e840a2b1 100644 --- a/internal/catalogue/catalogue_test.go +++ b/internal/catalogue/catalogue_test.go @@ -51,7 +51,7 @@ func newFakeMB(t *testing.T) *fakeMB { {"id": %q, "title": "Ghost Nights", "status": "Official", "date": "2005-05-11", "country": "GB", "media": [{"position": 1, "format": "CD", "tracks": [ {"position": 1, "number": "1", "title": "Intro", "length": 63000, "recording": {"id": "rec-intro"}}, - {"position": 2, "number": "2", "title": "Last Living Souls", "length": 190000, "recording": {"id": "rec-lls"}}]}]} + {"position": 2, "number": "2", "title": "Last Lit Rooms", "length": 190000, "recording": {"id": "rec-lls"}}]}]} ]}`, ghostNightsJ, ghostNightsR) default: w.WriteHeader(http.StatusNotFound) @@ -97,7 +97,7 @@ func TestRefreshReleaseGroup_ReadsEditionsAndTrackLists_Integration(t *testing.T } } if lls == nil || lls.ReleaseMbid != ghostNightsR || lls.LengthMs != 190000 { - t.Errorf("Last Living Souls = %+v", lls) + t.Errorf("Last Lit Rooms = %+v", lls) } // Refreshing replaces rather than adds. diff --git a/internal/library/genre.go b/internal/library/genre.go index e84b549f..f1f82f57 100644 --- a/internal/library/genre.go +++ b/internal/library/genre.go @@ -168,7 +168,7 @@ var genreAcronyms = map[string]string{ // how "Children's Music" became "Children'S Music". // // Deliberately a fixed list rather than "lowercase whatever follows an -// apostrophe": that broader rule would break "O'Brien" and "D'Angelo", which +// apostrophe": that broader rule would break "O'Brien" and "D'Arcy", which // are correctly capitalised after the apostrophe. var contractionSuffixes = map[string]bool{ "s": true, "t": true, "re": true, "ll": true, "ve": true, "d": true, "m": true, diff --git a/internal/library/genre_test.go b/internal/library/genre_test.go index 08262347..983693dd 100644 --- a/internal/library/genre_test.go +++ b/internal/library/genre_test.go @@ -345,7 +345,7 @@ func TestTrueUpCasing(t *testing.T) { // and must keep their capital — this is why the suffix list is fixed // rather than "lowercase anything after an apostrophe". {"irish surname", "O'Brien Core", "O'Brien Core"}, - {"french elision", "D'Angelo Soul", "D'Angelo Soul"}, + {"french elision", "D'Arcy Soul", "D'Arcy Soul"}, // Ordinary genres pass through untouched. Case is otherwise exposed as // the file says it — "Rock" vs "rock" stays a real distinction. diff --git a/internal/library/moved_test.go b/internal/library/moved_test.go index 246bac15..03d31491 100644 --- a/internal/library/moved_test.go +++ b/internal/library/moved_test.go @@ -66,8 +66,8 @@ func hashRow(n byte, path string) dbq.FindMissingTrackByAudioHashRow { func audioHash(b byte) []byte { return bytes.Repeat([]byte{b}, 32) } const ( - oldPath = "/music/Lincoln Yard/Minutes to Noon/02 - Bleed It Out.mp3" - newPath = "/music/Lincoln Yard/Minutes to Noon/04 - Bleed It Out.mp3" + oldPath = "/music/Lincoln Yard/Minutes to Noon/02 - Ring It Out.mp3" + newPath = "/music/Lincoln Yard/Minutes to Noon/04 - Ring It Out.mp3" ) // A new file is adopted as a missing track that moved when its recording MBID diff --git a/internal/library/scanner_test.go b/internal/library/scanner_test.go index 0648b937..d8d371c9 100644 --- a/internal/library/scanner_test.go +++ b/internal/library/scanner_test.go @@ -216,9 +216,9 @@ func TestScanner_AdoptsMovedFile_Integration(t *testing.T) { root := t.TempDir() const movedMBID = "11111111-2222-3333-4444-555555555555" - movedFrom := filepath.Join(root, "artistM/albumM/04 - Bleed It Out.mp3") + movedFrom := filepath.Join(root, "artistM/albumM/04 - Ring It Out.mp3") writeTestMP3(t, movedFrom, map[string]string{ - "TIT2": "Bleed It Out", "TPE1": "Artist M", "TALB": "Album M", "TRCK": "4", + "TIT2": "Ring It Out", "TPE1": "Artist M", "TALB": "Album M", "TRCK": "4", // dhowden surfaces TXXX as a Comm whose Description is the Picard tag // name; "MusicBrainz Track Id" is mbz.Recording. "TXXX": "MusicBrainz Track Id\x00" + movedMBID, @@ -246,7 +246,7 @@ func TestScanner_AdoptsMovedFile_Integration(t *testing.T) { } // Renumber the file, exactly as a tag editor would. - movedTo := filepath.Join(root, "artistM/albumM/02 - Bleed It Out.mp3") + movedTo := filepath.Join(root, "artistM/albumM/02 - Ring It Out.mp3") if err := os.Rename(movedFrom, movedTo); err != nil { t.Fatalf("rename: %v", err) } diff --git a/internal/library/song_link_test.go b/internal/library/song_link_test.go index 08714350..d20e9376 100644 --- a/internal/library/song_link_test.go +++ b/internal/library/song_link_test.go @@ -239,7 +239,7 @@ func TestResolveDuplicates_KeepsEveryCopyInACrossReleaseGroup_Integration(t *tes return tr } flac := track("Mammalz", "04 Neptunez Barz.flac", "flac") - mp3 := track("Mammalz", "06 Neptunez Barz (feat. Popcaan).mp3", "mp3") + mp3 := track("Mammalz", "06 Neptunez Barz (feat. Popkern).mp3", "mp3") single := track("Neptunez Barz", "01 Neptunez Barz.mp3", "mp3") var groupID pgtype.UUID if err := pool.QueryRow(ctx, diff --git a/internal/notifications/render.go b/internal/notifications/render.go index fd360600..9766c57a 100644 --- a/internal/notifications/render.go +++ b/internal/notifications/render.go @@ -33,8 +33,8 @@ type Payload struct { // Count is the coalesced kinds' running total since the notice was last // read. Count int64 `json:"count,omitempty"` - // Items name what Count counts, one each, newest first: "Glasshouse – Buddy - // Holly". A coalesced update puts its own in front and keeps ten, + // Items name what Count counts, one each, newest first: "Glasshouse – Lucky + // Penny". A coalesced update puts its own in front and keeps ten, // so the body can say which, not only how many. Items []string `json:"items,omitempty"` // Detail is free text: scan_failed's error message. Rows from before diff --git a/internal/tagread/tagread_test.go b/internal/tagread/tagread_test.go index c3f3d098..1edfcc86 100644 --- a/internal/tagread/tagread_test.go +++ b/internal/tagread/tagread_test.go @@ -65,7 +65,7 @@ func TestReadFrom_TrimsAStrayZeroAfterAUTF16Frame(t *testing.T) { // the value's byte order mark, the other at the end of the frame. func TestReadFrom_DropsTheStrayZeroAfterEachStringOfACustomField(t *testing.T) { name := append(utf16BE("ARTISTS"), 0) - value := utf16BE("Saint Motel") + value := utf16BE("Saint Hostel") value = append(value[1:len(value)-2], 0) // no encoding byte, no terminator, a stray zero strayField := append(name, value...) file := id3(4, @@ -81,7 +81,7 @@ func TestReadFrom_DropsTheStrayZeroAfterEachStringOfACustomField(t *testing.T) { t.Fatalf("ReadFrom: %v", err) } field, ok := meta.Raw()["TXXX"].(*tag.Comm) - if !ok || field.Description != "ARTISTS" || field.Text != "Saint Motel" { + if !ok || field.Description != "ARTISTS" || field.Text != "Saint Hostel" { t.Fatalf("TXXX = %#v", meta.Raw()["TXXX"]) } if meta.Genre() != "Pop" || meta.Title() != "Fine Wine" { diff --git a/web/src/routes/collection/missing/missing.test.ts b/web/src/routes/collection/missing/missing.test.ts index af826267..00552aff 100644 --- a/web/src/routes/collection/missing/missing.test.ts +++ b/web/src/routes/collection/missing/missing.test.ts @@ -47,8 +47,8 @@ const response: AdminMissingResponse = { directory: '/music/Lincoln Yard/Minutes to Noon', missing_since: new Date(Date.now() - 3 * DAY).toISOString(), tracks: [ - track('Given Up', { lastPlayed: new Date(Date.now() - 2 * DAY).toISOString() }), - track('Bleed It Out', { removedFor: 'report', removedBy: 'alice' }) + track('Paper Wings', { lastPlayed: new Date(Date.now() - 2 * DAY).toISOString() }), + track('Ring It Out', { removedFor: 'report', removedBy: 'alice' }) ] }, { @@ -151,10 +151,10 @@ describe('/collection/missing', () => { test('Forget asks first, then forgets the one track', async () => { renderWith(response); - await fireEvent.click(screen.getByRole('button', { name: 'Forget Given Up' })); + await fireEvent.click(screen.getByRole('button', { name: 'Forget Paper Wings' })); expect(forgetMissingTracks).not.toHaveBeenCalled(); await fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', { name: /confirm forget/i })); - await waitFor(() => expect(forgetMissingTracks).toHaveBeenCalledWith(['t-Given Up'])); + await waitFor(() => expect(forgetMissingTracks).toHaveBeenCalledWith(['t-Paper Wings'])); }); test('Forget all takes the whole folder', async () => { @@ -163,7 +163,7 @@ describe('/collection/missing', () => { screen.getByRole('button', { name: 'Forget the 2 tracks in /music/Lincoln Yard/Minutes to Noon' }) ); await fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', { name: /confirm forget/i })); - await waitFor(() => expect(forgetMissingTracks).toHaveBeenCalledWith(['t-Given Up', 't-Bleed It Out'])); + await waitFor(() => expect(forgetMissingTracks).toHaveBeenCalledWith(['t-Paper Wings', 't-Ring It Out'])); }); test('Export CSV links to the whole list', () => {