Skip to content

Add tests for get_key_value_mut and split_at_checked - #455

Open
connabyss wants to merge 1 commit into
indexmap-rs:mainfrom
connabyss:test/get-key-value-mut-split-at-checked
Open

connabyss wants to merge 1 commit into
indexmap-rs:mainfrom
connabyss:test/get-key-value-mut-split-at-checked

Conversation

@connabyss

Copy link
Copy Markdown

IndexMap::get_key_value_mut (#411) and Slice::split_at_checked / split_at_mut_checked (#430) don't have any tests or doc examples yet. This adds small unit tests next to the existing ones:

  • get_key_value_mut: a key that is there (and editing its value through the returned reference), and a key that isn't.
  • split_at_checked on map and set slices, and split_at_mut_checked on map slices: a split inside the slice, at its length, and past its length (None).

Tests only, no library changes. cargo test, cargo fmt --check and cargo clippy --all-features pass locally.

I wrote these with help from Claude Code (noted in the commit message).

IndexMap::get_key_value_mut (indexmap-rs#411) and Slice::split_at_checked /
split_at_mut_checked (indexmap-rs#430) had no tests or doc examples. These cover
a found and a missing key, a split inside the slice, at its length,
and past its length.

Assisted-by: Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant