From fe8909e8f2ff74eb35f463423a14f1fe785aa867 Mon Sep 17 00:00:00 2001 From: Peter Ammon Date: Thu, 19 Jun 2025 11:08:50 -0700 Subject: [PATCH] Fix an off-by-one error in reporting dropped history items This was introduced in the Rust port. The original C++ was pretty gnarly to be fair. --- src/tests/history.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tests/history.rs b/src/tests/history.rs index db1942f07..2b0329f74 100644 --- a/src/tests/history.rs +++ b/src/tests/history.rs @@ -309,7 +309,11 @@ fn test_history_races() { continue; }; - // Remove everything from this item on + // Remove the item we found. + list.remove(position); + + // We expected this item to be the last. Items after this item + // in this array were therefore not found in history. let removed = list.drain(position..); for line in removed.into_iter().rev() { printf!("Item dropped from history: %ls\n", line);