All the easy tests?
This commit is contained in:
parent
1e89092d62
commit
3baf125f4a
4 changed files with 753 additions and 749 deletions
|
@ -74,43 +74,43 @@ pub fn change_case(_: &mut Workspace, _: &ChangeCase, cx: &mut ViewContext<Works
|
|||
vim.switch_mode(Mode::Normal, true, cx)
|
||||
})
|
||||
}
|
||||
// #[cfg(test)]
|
||||
// mod test {
|
||||
// use crate::{state::Mode, test::NeovimBackedTestContext};
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::{state::Mode, test::NeovimBackedTestContext};
|
||||
|
||||
// #[gpui::test]
|
||||
// async fn test_change_case(cx: &mut gpui::TestAppContext) {
|
||||
// let mut cx = NeovimBackedTestContext::new(cx).await;
|
||||
// cx.set_shared_state("ˇabC\n").await;
|
||||
// cx.simulate_shared_keystrokes(["~"]).await;
|
||||
// cx.assert_shared_state("AˇbC\n").await;
|
||||
// cx.simulate_shared_keystrokes(["2", "~"]).await;
|
||||
// cx.assert_shared_state("ABˇc\n").await;
|
||||
#[gpui::test]
|
||||
async fn test_change_case(cx: &mut gpui::TestAppContext) {
|
||||
let mut cx = NeovimBackedTestContext::new(cx).await;
|
||||
cx.set_shared_state("ˇabC\n").await;
|
||||
cx.simulate_shared_keystrokes(["~"]).await;
|
||||
cx.assert_shared_state("AˇbC\n").await;
|
||||
cx.simulate_shared_keystrokes(["2", "~"]).await;
|
||||
cx.assert_shared_state("ABˇc\n").await;
|
||||
|
||||
// // works in visual mode
|
||||
// cx.set_shared_state("a😀C«dÉ1*fˇ»\n").await;
|
||||
// cx.simulate_shared_keystrokes(["~"]).await;
|
||||
// cx.assert_shared_state("a😀CˇDé1*F\n").await;
|
||||
// works in visual mode
|
||||
cx.set_shared_state("a😀C«dÉ1*fˇ»\n").await;
|
||||
cx.simulate_shared_keystrokes(["~"]).await;
|
||||
cx.assert_shared_state("a😀CˇDé1*F\n").await;
|
||||
|
||||
// // works with multibyte characters
|
||||
// cx.simulate_shared_keystrokes(["~"]).await;
|
||||
// cx.set_shared_state("aˇC😀é1*F\n").await;
|
||||
// cx.simulate_shared_keystrokes(["4", "~"]).await;
|
||||
// cx.assert_shared_state("ac😀É1ˇ*F\n").await;
|
||||
// works with multibyte characters
|
||||
cx.simulate_shared_keystrokes(["~"]).await;
|
||||
cx.set_shared_state("aˇC😀é1*F\n").await;
|
||||
cx.simulate_shared_keystrokes(["4", "~"]).await;
|
||||
cx.assert_shared_state("ac😀É1ˇ*F\n").await;
|
||||
|
||||
// // works with line selections
|
||||
// cx.set_shared_state("abˇC\n").await;
|
||||
// cx.simulate_shared_keystrokes(["shift-v", "~"]).await;
|
||||
// cx.assert_shared_state("ˇABc\n").await;
|
||||
// works with line selections
|
||||
cx.set_shared_state("abˇC\n").await;
|
||||
cx.simulate_shared_keystrokes(["shift-v", "~"]).await;
|
||||
cx.assert_shared_state("ˇABc\n").await;
|
||||
|
||||
// // works in visual block mode
|
||||
// cx.set_shared_state("ˇaa\nbb\ncc").await;
|
||||
// cx.simulate_shared_keystrokes(["ctrl-v", "j", "~"]).await;
|
||||
// cx.assert_shared_state("ˇAa\nBb\ncc").await;
|
||||
// works in visual block mode
|
||||
cx.set_shared_state("ˇaa\nbb\ncc").await;
|
||||
cx.simulate_shared_keystrokes(["ctrl-v", "j", "~"]).await;
|
||||
cx.assert_shared_state("ˇAa\nBb\ncc").await;
|
||||
|
||||
// // works with multiple cursors (zed only)
|
||||
// cx.set_state("aˇßcdˇe\n", Mode::Normal);
|
||||
// cx.simulate_keystroke("~");
|
||||
// cx.assert_state("aSSˇcdˇE\n", Mode::Normal);
|
||||
// }
|
||||
// }
|
||||
// works with multiple cursors (zed only)
|
||||
cx.set_state("aˇßcdˇe\n", Mode::Normal);
|
||||
cx.simulate_keystroke("~");
|
||||
cx.assert_state("aSSˇcdˇE\n", Mode::Normal);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue