Skip to content

refactor(locallibrary): state what edit and profile lookups can't miss - #457

Merged
botandbang merged 2 commits into
mainfrom
bnb/edit-expect-proofs
Nov 5, 2026
Merged

botandbang merged 2 commits into
mainfrom
bnb/edit-expect-proofs

Conversation

@botandbang

Copy link
Copy Markdown
Contributor

Replaces fallbacks that can't run with expect calls that say why, so a reader doesn't have to work out what the quiet branch was for and coverage stops counting code nothing can reach. None of these changes what any input does.

Changed

  • Op::Rename and Op::SetEntries in edit.rs update the playlist find_node just found with expect. find_node walks lib.playlists, and no EditDb removes a playlist in rename or set_entries.
  • Filling a playlist that isn't found returns list(spec).expect_err(..). found is the same lookup as list (find_playlist_of_kind and at_recorded_path), so list can't succeed there.
  • Files::locate in profile/mod.rs takes the store with expect for Origin::Snapshot. Both places that make one are inside if let Some(store) = sources.store, and Files::store is that same store.
  • style in profile/mod.rs takes each setting's definition with expect. describe is only called with STYLE_SETTINGS keys.

Added

  • every_style_setting_is_a_setting, so renaming one of those settings in the schema fails a test rather than panicking in style.

Removed

  • The plan.is_noop() check in replay_set_path. A strict plan of one Edit::SetPath that comes back Ok always holds an Op::SetPath, which is_noop counts as a change.

These branches can't run, so they hid the reason they can't. Say it with expect, or drop the check
where nothing can reach it.
@botandbang
botandbang requested a review from bnb as a code owner November 5, 2026 16:07
@github-actions github-actions Bot added locallibrary locallibrary and the loclib-* crates locallibrary: core The core crate, the data model and rekordbox's formats locallibrary: publishing The Atmosphere account, and the sets and profile published to it tests Tests, fixtures and test harnesses labels Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Rust coverage

From run 366. Both are held to the thresholds in .cargo/config.toml.

Tests Lines Functions Regions
All 97.67% (87922/90019) 97.07% (14303/14734) 96.06% (194345/202314)
Hegel property tests alone 96.09% (86499/90019) 95.41% (14057/14734) 94.36% (190903/202314)

@botandbang
botandbang added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 8f80c7e Nov 5, 2026
32 checks passed
@botandbang
botandbang deleted the bnb/edit-expect-proofs branch November 5, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

locallibrary: core The core crate, the data model and rekordbox's formats locallibrary: publishing The Atmosphere account, and the sets and profile published to it locallibrary locallibrary and the loclib-* crates tests Tests, fixtures and test harnesses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants