From 8cadf56d5a835da844c70c54f026a22f6c640c8f Mon Sep 17 00:00:00 2001 From: mgunyho <20118130+mgunyho@users.noreply.github.com> Date: Thu, 21 Dec 2023 15:21:37 +0200 Subject: [PATCH] Fix and improve case sensitive mode test Not sure why it was broken in the first place... See also discussion in Github issue #93 --- src/app_state.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app_state.rs b/src/app_state.rs index 5dcdc52e..eb17465b 100644 --- a/src/app_state.rs +++ b/src/app_state.rs @@ -1696,20 +1696,20 @@ mod tests { fn test_case_sensitive_mode_change() { let tmp = TempDir::new().unwrap(); let mut s = create_test_state_with_folders(&tmp, 10, vec!["A", "a"]); - s.cursor_pos = 2; + s.cursor_pos = 1; s.advance_search("a"); // current state: ('*' shows the matches) // .. - // A * - // > a * + // > A * + // a * assert_eq!(s.visible_match_indices(), vec![1, 2]); - assert_eq!(s.cursor_pos, 2); + assert_eq!(s.cursor_pos, 1); s.set_case_sensitive(CaseSensitiveMode::CaseSensitive); - assert_eq!(s.visible_match_indices(), vec![1]); - assert_eq!(s.cursor_pos, 1); + assert_eq!(s.visible_match_indices(), vec![2]); + assert_eq!(s.cursor_pos, 2); } #[test]