Skip to content

Commit d49df10

Browse files
unhappychoiceclaude
andcommitted
test: address Clippy lint and version drift in About overlay assertion
- Use `Range::contains` instead of manual lower/upper checks in the large_diff_fixture helper to satisfy `clippy::manual_range_contains`. - Build the expected `Version <pkg>` string from `env!("CARGO_PKG_VERSION")` in the keybindings/About overlay test so it stays in sync with crate version bumps instead of asserting the literal `"Version 0.8.0"`. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 parent 3a8dbcf commit d49df10

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/git.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,10 +1408,10 @@ mod tests {
14081408
fn large_diff_fixture(label: &str) -> String {
14091409
(0..2_105)
14101410
.map(|index| {
1411-
let marker = if index < 3 || index >= 2_102 {
1412-
"context"
1413-
} else {
1411+
let marker = if (3..2_102).contains(&index) {
14141412
label
1413+
} else {
1414+
"context"
14151415
};
14161416
format!("{marker}-{index:04}-{}\n", "x".repeat(240))
14171417
})

‎src/ui.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1664,7 +1664,7 @@ mod tests {
16641664
let about = buffer_text(&render_buffer(&mut about_ui, 80, 24));
16651665

16661666
assert!(about.contains("About (Esc to close)"));
1667-
assert!(about.contains("Version 0.8.0"));
1667+
assert!(about.contains(&format!("Version {}", env!("CARGO_PKG_VERSION"))));
16681668
assert!(about.contains("https://github.com/unhappychoice/gitlogue"));
16691669
}
16701670

0 commit comments

Comments
 (0)