From 0cb595e226c9970989ee1e680ae6b8011d188cbf Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Wed, 30 Aug 2023 06:26:21 +0200 Subject: transition to nucleo for fuzzy matching (#7814) * transition to nucleo for fuzzy matching * drop flakey test case since the picker streams in results now any test that relies on the picker containing results is potentially flakely * use crates.io version of nucleo * Fix typo in commands.rs Co-authored-by: Skyler Hawthorne --------- Co-authored-by: Skyler Hawthorne --- helix-term/tests/integration.rs | 1 - helix-term/tests/test/picker.rs | 80 ----------------------------------------- 2 files changed, 81 deletions(-) delete mode 100644 helix-term/tests/test/picker.rs (limited to 'helix-term/tests') diff --git a/helix-term/tests/integration.rs b/helix-term/tests/integration.rs index 9c0e6bbc..35214bcb 100644 --- a/helix-term/tests/integration.rs +++ b/helix-term/tests/integration.rs @@ -20,7 +20,6 @@ mod test { mod commands; mod languages; mod movement; - mod picker; mod prompt; mod splits; } diff --git a/helix-term/tests/test/picker.rs b/helix-term/tests/test/picker.rs deleted file mode 100644 index 89e6531f..00000000 --- a/helix-term/tests/test/picker.rs +++ /dev/null @@ -1,80 +0,0 @@ -use std::fs; - -use helix_core::{path::get_canonicalized_path, Range}; -use helix_loader::{current_working_dir, set_current_working_dir}; -use helix_view::{current_ref, editor::Action}; -use tempfile::{Builder, TempDir}; - -use super::*; - -#[tokio::test(flavor = "multi_thread")] -async fn test_picker_alt_ret() -> anyhow::Result<()> { - // Create two files, open the first and run a global search for a word - // from the second file. Press to have helix open the second file in the - // new buffer, but not change focus. Then check whether the word is highlighted - // correctly and the view of the first file has not changed. - let tmp_dir = TempDir::new()?; - set_current_working_dir(tmp_dir.path().into())?; - - let mut app = AppBuilder::new().build()?; - - log::debug!( - "set current working directory to {:?}", - current_working_dir() - ); - - // Add prefix so helix doesn't hide these files in a picker - let files = [ - Builder::new().prefix("1").tempfile_in(&tmp_dir)?, - Builder::new().prefix("2").tempfile_in(&tmp_dir)?, - ]; - let paths = files - .iter() - .map(|f| get_canonicalized_path(f.path())) - .collect::>(); - - fs::write(&paths[0], "1\n2\n3\n4")?; - fs::write(&paths[1], "first\nsecond")?; - - log::debug!( - "created and wrote two temporary files: {:?} & {:?}", - paths[0], - paths[1] - ); - - // Manually open to save the offset, otherwise we won't be able to change the state in the Fn trait - app.editor.open(files[0].path(), Action::Replace)?; - let view_offset = current_ref!(app.editor).0.offset; - - test_key_sequences( - &mut app, - vec![ - (Some("/"), None), - (Some("second"), None), - ( - Some(""), - Some(&|app| { - let (view, doc) = current_ref!(app.editor); - assert_eq!(doc.path().unwrap(), &paths[0]); - let select_ranges = doc.selection(view.id).ranges(); - assert_eq!(select_ranges[0], Range::new(0, 1)); - assert_eq!(view.offset, view_offset); - }), - ), - ( - Some(":buffernext"), - Some(&|app| { - let (view, doc) = current_ref!(app.editor); - assert_eq!(doc.path().unwrap(), &paths[1]); - let select_ranges = doc.selection(view.id).ranges(); - assert_eq!(select_ranges.len(), 1); - assert_eq!(select_ranges[0], Range::new(6, 12)); - }), - ), - ], - false, - ) - .await?; - - Ok(()) -} -- cgit v1.2.3-70-g09d2