You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(output): shared table/ID renderers and generic field selection - #42
The observable rendering paths are otherwise well pinned:
Table shape is covered for track, album, artist, and playlist with exact byte strings, including headers, | delimiters, trailing newlines, and header-only empty pages. The album/artist empty cases are exercised through search command tests; track and playlist also have direct output tests.
Saved-track and saved-album tests pin both the ADDED_AT header and a rendered timestamp value.
Removing the TrackAddedAt and AlbumAddedAt cases from trackCell/albumCell is observationally neutral: each deleted case returned -, exactly as the unchanged default branch does. Saved values still route through savedTrackCell/savedAlbumCell and are covered.
Saved IDs are pinned: the track library --id test exercises RenderSavedTrackIDs; saved albums are covered both directly and through library --id. The allocation removal therefore has output coverage.
The gap is the four family-specific unknown-field messages. Existing tests only use strings.Contains on the valid fields: suffix, so all would pass if the shared helper supplied the wrong noun. In particular, playlist does not pin unknown playlist field.
Cheapest fix: strengthen the existing assertions in internal/output/track_test.go (TestTrackProjectionRejectsUnknownAndIDsHaveNoHeader), internal/output/catalog_test.go (TestRenderAlbumsShapes and TestRenderArtistsShapes), and internal/output/playlist_test.go (TestPlaylistFieldsAndRendering) to compare the full errors:
unknown track field "nope"; valid fields: ID, TRACK, ARTIST_IDS, ARTISTS, ALBUM_ID, ALBUM, DURATION, URI, URL, DISC_NUMBER, TRACK_NUMBER, EXPLICIT, RESTRICTION, ARTWORK
unknown album field "nope"; valid fields: ID, ALBUM, ARTIST_IDS, ARTISTS, RELEASE_DATE, TOTAL_TRACKS, URI, URL, ALBUM_TYPE, RELEASE_DATE_PRECISION, RESTRICTION, ARTWORK
unknown artist field "nope"; valid fields: ID, ARTIST, URI, URL, ARTWORK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LOC delta: +114/-322 (net -208)
Playlist scope
Verification
go build ./...go vet ./...make testgolangci-lint runCloses #32