From 459f7e3403d53068aceabfe20b292eef1a914d0c Mon Sep 17 00:00:00 2001 From: fantacell Date: Tue, 8 Jul 2025 15:02:09 +0200 Subject: [PATCH] Add a test --- crates/vim/src/object.rs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/crates/vim/src/object.rs b/crates/vim/src/object.rs index fdc4357ab2..44f314a427 100644 --- a/crates/vim/src/object.rs +++ b/crates/vim/src/object.rs @@ -1822,6 +1822,45 @@ mod test { .assert_matches(); } + #[gpui::test] + async fn test_select_word_object(cx: &mut gpui::TestAppContext) { + let mut cx = VimTestContext::new(cx, true).await; + let start = indoc! {" + The quick brˇowˇnˇ + fox «ˇjumps» ov«er + the laˇ»zy dogˇ + " + }; + + cx.set_state(start, Mode::HelixNormal); + + cx.simulate_keystrokes("m i w"); + + cx.assert_state( + indoc! {" + The quick «brownˇ» + fox «jumpsˇ» over + the «lazyˇ» dogˇ + " + }, + Mode::HelixNormal, + ); + + cx.set_state(start, Mode::HelixNormal); + + cx.simulate_keystrokes("m a w"); + + cx.assert_state( + indoc! {" + The quick« brownˇ» + fox «jumps ˇ»over + the «lazy ˇ»dogˇ + " + }, + Mode::HelixNormal, + ); + } + #[gpui::test] async fn test_visual_word_object(cx: &mut gpui::TestAppContext) { let mut cx = NeovimBackedTestContext::new(cx).await;