Skip to content

Commit

Permalink
Fix and improve case sensitive mode test
Browse files Browse the repository at this point in the history
Not sure why it was broken in the first place...

See also discussion in Github issue #93
  • Loading branch information
mgunyho committed Dec 21, 2023
1 parent 3cd8048 commit 8cadf56
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/app_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 8cadf56

Please sign in to comment.