From b7b8c03c51e5f4dc44d0d2bbf3be420be6114e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BF=BA=E4=B8=8D=E5=8F=AB=E5=8C=96=E5=92=95=E9=BE=99?= <1801943622@qq.com> Date: Fri, 29 May 2026 21:01:02 +0800 Subject: [PATCH] Add timeout testcase --- crates/vim/src/test.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/crates/vim/src/test.rs b/crates/vim/src/test.rs index df6fac20aca..ab8f75fcb9e 100644 --- a/crates/vim/src/test.rs +++ b/crates/vim/src/test.rs @@ -1447,6 +1447,29 @@ async fn test_pending_input_mapping_output_undo(cx: &mut gpui::TestAppContext) { cx.assert_state("ˇone", Mode::Normal); } +#[perf] +#[gpui::test] +async fn test_pending_input_mapping_output_undo_delay(cx: &mut gpui::TestAppContext) { + let mut cx = VimTestContext::new(cx, true).await; + + cx.update(|_, cx| { + cx.bind_keys([KeyBinding::new( + "a b c", + HandleInput("d".to_string()), + Some("vim_mode == insert"), + )]) + }); + + cx.set_state("ˇone", Mode::Normal); + cx.simulate_keystrokes("i a b"); + cx.executor().advance_clock(Duration::from_millis(1500)); + cx.run_until_parked(); + cx.assert_state("abˇone", Mode::Insert); + + cx.simulate_keystrokes("escape u"); + cx.assert_state("ˇone", Mode::Normal); +} + #[perf] #[gpui::test] async fn test_lsp_completions_undo(cx: &mut gpui::TestAppContext) {