All the easy tests?
This commit is contained in:
parent
1e89092d62
commit
3baf125f4a
4 changed files with 753 additions and 749 deletions
|
@ -36,100 +36,90 @@ fn normal_before(_: &mut Workspace, action: &NormalBefore, cx: &mut ViewContext<
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// #[cfg(test)]
|
#[cfg(test)]
|
||||||
// mod test {
|
mod test {
|
||||||
// use std::sync::Arc;
|
use crate::{
|
||||||
|
state::Mode,
|
||||||
|
test::{NeovimBackedTestContext, VimTestContext},
|
||||||
|
};
|
||||||
|
|
||||||
// use gpui::executor::Deterministic;
|
#[gpui::test]
|
||||||
|
async fn test_enter_and_exit_insert_mode(cx: &mut gpui::TestAppContext) {
|
||||||
|
let mut cx = VimTestContext::new(cx, true).await;
|
||||||
|
cx.simulate_keystroke("i");
|
||||||
|
assert_eq!(cx.mode(), Mode::Insert);
|
||||||
|
cx.simulate_keystrokes(["T", "e", "s", "t"]);
|
||||||
|
cx.assert_editor_state("Testˇ");
|
||||||
|
cx.simulate_keystroke("escape");
|
||||||
|
assert_eq!(cx.mode(), Mode::Normal);
|
||||||
|
cx.assert_editor_state("Tesˇt");
|
||||||
|
}
|
||||||
|
|
||||||
// use crate::{
|
#[gpui::test]
|
||||||
// state::Mode,
|
async fn test_insert_with_counts(cx: &mut gpui::TestAppContext) {
|
||||||
// test::{NeovimBackedTestContext, VimTestContext},
|
let mut cx = NeovimBackedTestContext::new(cx).await;
|
||||||
// };
|
|
||||||
|
|
||||||
// #[gpui::test]
|
cx.set_shared_state("ˇhello\n").await;
|
||||||
// async fn test_enter_and_exit_insert_mode(cx: &mut gpui::TestAppContext) {
|
cx.simulate_shared_keystrokes(["5", "i", "-", "escape"])
|
||||||
// let mut cx = VimTestContext::new(cx, true).await;
|
.await;
|
||||||
// cx.simulate_keystroke("i");
|
cx.run_until_parked();
|
||||||
// assert_eq!(cx.mode(), Mode::Insert);
|
cx.assert_shared_state("----ˇ-hello\n").await;
|
||||||
// cx.simulate_keystrokes(["T", "e", "s", "t"]);
|
|
||||||
// cx.assert_editor_state("Testˇ");
|
|
||||||
// cx.simulate_keystroke("escape");
|
|
||||||
// assert_eq!(cx.mode(), Mode::Normal);
|
|
||||||
// cx.assert_editor_state("Tesˇt");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// #[gpui::test]
|
cx.set_shared_state("ˇhello\n").await;
|
||||||
// async fn test_insert_with_counts(
|
cx.simulate_shared_keystrokes(["5", "a", "-", "escape"])
|
||||||
// deterministic: Arc<Deterministic>,
|
.await;
|
||||||
// cx: &mut gpui::TestAppContext,
|
cx.run_until_parked();
|
||||||
// ) {
|
cx.assert_shared_state("h----ˇ-ello\n").await;
|
||||||
// let mut cx = NeovimBackedTestContext::new(cx).await;
|
|
||||||
|
|
||||||
// cx.set_shared_state("ˇhello\n").await;
|
cx.simulate_shared_keystrokes(["4", "shift-i", "-", "escape"])
|
||||||
// cx.simulate_shared_keystrokes(["5", "i", "-", "escape"])
|
.await;
|
||||||
// .await;
|
cx.run_until_parked();
|
||||||
// deterministic.run_until_parked();
|
cx.assert_shared_state("---ˇ-h-----ello\n").await;
|
||||||
// cx.assert_shared_state("----ˇ-hello\n").await;
|
|
||||||
|
|
||||||
// cx.set_shared_state("ˇhello\n").await;
|
cx.simulate_shared_keystrokes(["3", "shift-a", "-", "escape"])
|
||||||
// cx.simulate_shared_keystrokes(["5", "a", "-", "escape"])
|
.await;
|
||||||
// .await;
|
cx.run_until_parked();
|
||||||
// deterministic.run_until_parked();
|
cx.assert_shared_state("----h-----ello--ˇ-\n").await;
|
||||||
// cx.assert_shared_state("h----ˇ-ello\n").await;
|
|
||||||
|
|
||||||
// cx.simulate_shared_keystrokes(["4", "shift-i", "-", "escape"])
|
cx.set_shared_state("ˇhello\n").await;
|
||||||
// .await;
|
cx.simulate_shared_keystrokes(["3", "o", "o", "i", "escape"])
|
||||||
// deterministic.run_until_parked();
|
.await;
|
||||||
// cx.assert_shared_state("---ˇ-h-----ello\n").await;
|
cx.run_until_parked();
|
||||||
|
cx.assert_shared_state("hello\noi\noi\noˇi\n").await;
|
||||||
|
|
||||||
// cx.simulate_shared_keystrokes(["3", "shift-a", "-", "escape"])
|
cx.set_shared_state("ˇhello\n").await;
|
||||||
// .await;
|
cx.simulate_shared_keystrokes(["3", "shift-o", "o", "i", "escape"])
|
||||||
// deterministic.run_until_parked();
|
.await;
|
||||||
// cx.assert_shared_state("----h-----ello--ˇ-\n").await;
|
cx.run_until_parked();
|
||||||
|
cx.assert_shared_state("oi\noi\noˇi\nhello\n").await;
|
||||||
|
}
|
||||||
|
|
||||||
// cx.set_shared_state("ˇhello\n").await;
|
#[gpui::test]
|
||||||
// cx.simulate_shared_keystrokes(["3", "o", "o", "i", "escape"])
|
async fn test_insert_with_repeat(cx: &mut gpui::TestAppContext) {
|
||||||
// .await;
|
let mut cx = NeovimBackedTestContext::new(cx).await;
|
||||||
// deterministic.run_until_parked();
|
|
||||||
// cx.assert_shared_state("hello\noi\noi\noˇi\n").await;
|
|
||||||
|
|
||||||
// cx.set_shared_state("ˇhello\n").await;
|
cx.set_shared_state("ˇhello\n").await;
|
||||||
// cx.simulate_shared_keystrokes(["3", "shift-o", "o", "i", "escape"])
|
cx.simulate_shared_keystrokes(["3", "i", "-", "escape"])
|
||||||
// .await;
|
.await;
|
||||||
// deterministic.run_until_parked();
|
cx.run_until_parked();
|
||||||
// cx.assert_shared_state("oi\noi\noˇi\nhello\n").await;
|
cx.assert_shared_state("--ˇ-hello\n").await;
|
||||||
// }
|
cx.simulate_shared_keystrokes(["."]).await;
|
||||||
|
cx.run_until_parked();
|
||||||
|
cx.assert_shared_state("----ˇ--hello\n").await;
|
||||||
|
cx.simulate_shared_keystrokes(["2", "."]).await;
|
||||||
|
cx.run_until_parked();
|
||||||
|
cx.assert_shared_state("-----ˇ---hello\n").await;
|
||||||
|
|
||||||
// #[gpui::test]
|
cx.set_shared_state("ˇhello\n").await;
|
||||||
// async fn test_insert_with_repeat(
|
cx.simulate_shared_keystrokes(["2", "o", "k", "k", "escape"])
|
||||||
// deterministic: Arc<Deterministic>,
|
.await;
|
||||||
// cx: &mut gpui::TestAppContext,
|
cx.run_until_parked();
|
||||||
// ) {
|
cx.assert_shared_state("hello\nkk\nkˇk\n").await;
|
||||||
// let mut cx = NeovimBackedTestContext::new(cx).await;
|
cx.simulate_shared_keystrokes(["."]).await;
|
||||||
|
cx.run_until_parked();
|
||||||
// cx.set_shared_state("ˇhello\n").await;
|
cx.assert_shared_state("hello\nkk\nkk\nkk\nkˇk\n").await;
|
||||||
// cx.simulate_shared_keystrokes(["3", "i", "-", "escape"])
|
cx.simulate_shared_keystrokes(["1", "."]).await;
|
||||||
// .await;
|
cx.run_until_parked();
|
||||||
// deterministic.run_until_parked();
|
cx.assert_shared_state("hello\nkk\nkk\nkk\nkk\nkˇk\n").await;
|
||||||
// cx.assert_shared_state("--ˇ-hello\n").await;
|
}
|
||||||
// cx.simulate_shared_keystrokes(["."]).await;
|
}
|
||||||
// deterministic.run_until_parked();
|
|
||||||
// cx.assert_shared_state("----ˇ--hello\n").await;
|
|
||||||
// cx.simulate_shared_keystrokes(["2", "."]).await;
|
|
||||||
// deterministic.run_until_parked();
|
|
||||||
// cx.assert_shared_state("-----ˇ---hello\n").await;
|
|
||||||
|
|
||||||
// cx.set_shared_state("ˇhello\n").await;
|
|
||||||
// cx.simulate_shared_keystrokes(["2", "o", "k", "k", "escape"])
|
|
||||||
// .await;
|
|
||||||
// deterministic.run_until_parked();
|
|
||||||
// cx.assert_shared_state("hello\nkk\nkˇk\n").await;
|
|
||||||
// cx.simulate_shared_keystrokes(["."]).await;
|
|
||||||
// deterministic.run_until_parked();
|
|
||||||
// cx.assert_shared_state("hello\nkk\nkk\nkk\nkˇk\n").await;
|
|
||||||
// cx.simulate_shared_keystrokes(["1", "."]).await;
|
|
||||||
// deterministic.run_until_parked();
|
|
||||||
// cx.assert_shared_state("hello\nkk\nkk\nkk\nkk\nkˇk\n").await;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
|
@ -952,147 +952,156 @@ pub(crate) fn next_line_end(
|
||||||
end_of_line(map, false, point)
|
end_of_line(map, false, point)
|
||||||
}
|
}
|
||||||
|
|
||||||
// #[cfg(test)]
|
#[cfg(test)]
|
||||||
// mod test {
|
mod test {
|
||||||
|
|
||||||
// use crate::test::NeovimBackedTestContext;
|
use crate::test::NeovimBackedTestContext;
|
||||||
// use indoc::indoc;
|
use indoc::indoc;
|
||||||
|
|
||||||
// #[gpui::test]
|
#[gpui::test]
|
||||||
// async fn test_start_end_of_paragraph(cx: &mut gpui::TestAppContext) {
|
async fn test_start_end_of_paragraph(cx: &mut gpui::TestAppContext) {
|
||||||
// let mut cx = NeovimBackedTestContext::new(cx).await;
|
let mut cx = NeovimBackedTestContext::new(cx).await;
|
||||||
|
|
||||||
// let initial_state = indoc! {r"ˇabc
|
let initial_state = indoc! {r"ˇabc
|
||||||
// def
|
def
|
||||||
|
|
||||||
// paragraph
|
paragraph
|
||||||
// the second
|
the second
|
||||||
|
|
||||||
// third and
|
|
||||||
// final"};
|
|
||||||
|
|
||||||
// // goes down once
|
|
||||||
// cx.set_shared_state(initial_state).await;
|
|
||||||
// cx.simulate_shared_keystrokes(["}"]).await;
|
|
||||||
// cx.assert_shared_state(indoc! {r"abc
|
|
||||||
// def
|
|
||||||
// ˇ
|
|
||||||
// paragraph
|
|
||||||
// the second
|
|
||||||
|
|
||||||
// third and
|
third and
|
||||||
// final"})
|
final"};
|
||||||
// .await;
|
|
||||||
|
|
||||||
// // goes up once
|
// goes down once
|
||||||
// cx.simulate_shared_keystrokes(["{"]).await;
|
cx.set_shared_state(initial_state).await;
|
||||||
// cx.assert_shared_state(initial_state).await;
|
cx.simulate_shared_keystrokes(["}"]).await;
|
||||||
|
cx.assert_shared_state(indoc! {r"abc
|
||||||
|
def
|
||||||
|
ˇ
|
||||||
|
paragraph
|
||||||
|
the second
|
||||||
|
|
||||||
// // goes down twice
|
|
||||||
// cx.simulate_shared_keystrokes(["2", "}"]).await;
|
|
||||||
// cx.assert_shared_state(indoc! {r"abc
|
|
||||||
// def
|
|
||||||
|
|
||||||
// paragraph
|
|
||||||
// the second
|
|
||||||
// ˇ
|
|
||||||
|
|
||||||
// third and
|
third and
|
||||||
// final"})
|
final"})
|
||||||
// .await;
|
.await;
|
||||||
|
|
||||||
// // goes down over multiple blanks
|
// goes up once
|
||||||
// cx.simulate_shared_keystrokes(["}"]).await;
|
cx.simulate_shared_keystrokes(["{"]).await;
|
||||||
// cx.assert_shared_state(indoc! {r"abc
|
cx.assert_shared_state(initial_state).await;
|
||||||
// def
|
|
||||||
|
|
||||||
// paragraph
|
// goes down twice
|
||||||
// the second
|
cx.simulate_shared_keystrokes(["2", "}"]).await;
|
||||||
|
cx.assert_shared_state(indoc! {r"abc
|
||||||
|
def
|
||||||
|
|
||||||
// third and
|
paragraph
|
||||||
// finaˇl"})
|
the second
|
||||||
// .await;
|
ˇ
|
||||||
|
|
||||||
// // goes up twice
|
|
||||||
// cx.simulate_shared_keystrokes(["2", "{"]).await;
|
|
||||||
// cx.assert_shared_state(indoc! {r"abc
|
|
||||||
// def
|
|
||||||
// ˇ
|
|
||||||
// paragraph
|
|
||||||
// the second
|
|
||||||
|
|
||||||
// third and
|
third and
|
||||||
// final"})
|
final"})
|
||||||
// .await
|
.await;
|
||||||
// }
|
|
||||||
|
|
||||||
// #[gpui::test]
|
// goes down over multiple blanks
|
||||||
// async fn test_matching(cx: &mut gpui::TestAppContext) {
|
cx.simulate_shared_keystrokes(["}"]).await;
|
||||||
// let mut cx = NeovimBackedTestContext::new(cx).await;
|
cx.assert_shared_state(indoc! {r"abc
|
||||||
|
def
|
||||||
|
|
||||||
// cx.set_shared_state(indoc! {r"func ˇ(a string) {
|
paragraph
|
||||||
// do(something(with<Types>.and_arrays[0, 2]))
|
the second
|
||||||
// }"})
|
|
||||||
// .await;
|
|
||||||
// cx.simulate_shared_keystrokes(["%"]).await;
|
|
||||||
// cx.assert_shared_state(indoc! {r"func (a stringˇ) {
|
|
||||||
// do(something(with<Types>.and_arrays[0, 2]))
|
|
||||||
// }"})
|
|
||||||
// .await;
|
|
||||||
|
|
||||||
// // test it works on the last character of the line
|
|
||||||
// cx.set_shared_state(indoc! {r"func (a string) ˇ{
|
|
||||||
// do(something(with<Types>.and_arrays[0, 2]))
|
|
||||||
// }"})
|
|
||||||
// .await;
|
|
||||||
// cx.simulate_shared_keystrokes(["%"]).await;
|
|
||||||
// cx.assert_shared_state(indoc! {r"func (a string) {
|
|
||||||
// do(something(with<Types>.and_arrays[0, 2]))
|
|
||||||
// ˇ}"})
|
|
||||||
// .await;
|
|
||||||
|
|
||||||
// // test it works on immediate nesting
|
|
||||||
// cx.set_shared_state("ˇ{()}").await;
|
|
||||||
// cx.simulate_shared_keystrokes(["%"]).await;
|
|
||||||
// cx.assert_shared_state("{()ˇ}").await;
|
|
||||||
// cx.simulate_shared_keystrokes(["%"]).await;
|
|
||||||
// cx.assert_shared_state("ˇ{()}").await;
|
|
||||||
|
|
||||||
// // test it works on immediate nesting inside braces
|
third and
|
||||||
// cx.set_shared_state("{\n ˇ{()}\n}").await;
|
finaˇl"})
|
||||||
// cx.simulate_shared_keystrokes(["%"]).await;
|
.await;
|
||||||
// cx.assert_shared_state("{\n {()ˇ}\n}").await;
|
|
||||||
|
|
||||||
// // test it jumps to the next paren on a line
|
// goes up twice
|
||||||
// cx.set_shared_state("func ˇboop() {\n}").await;
|
cx.simulate_shared_keystrokes(["2", "{"]).await;
|
||||||
// cx.simulate_shared_keystrokes(["%"]).await;
|
cx.assert_shared_state(indoc! {r"abc
|
||||||
// cx.assert_shared_state("func boop(ˇ) {\n}").await;
|
def
|
||||||
// }
|
ˇ
|
||||||
|
paragraph
|
||||||
|
the second
|
||||||
|
|
||||||
// #[gpui::test]
|
|
||||||
// async fn test_comma_semicolon(cx: &mut gpui::TestAppContext) {
|
|
||||||
// let mut cx = NeovimBackedTestContext::new(cx).await;
|
|
||||||
|
|
||||||
// cx.set_shared_state("ˇone two three four").await;
|
|
||||||
// cx.simulate_shared_keystrokes(["f", "o"]).await;
|
|
||||||
// cx.assert_shared_state("one twˇo three four").await;
|
|
||||||
// cx.simulate_shared_keystrokes([","]).await;
|
|
||||||
// cx.assert_shared_state("ˇone two three four").await;
|
|
||||||
// cx.simulate_shared_keystrokes(["2", ";"]).await;
|
|
||||||
// cx.assert_shared_state("one two three fˇour").await;
|
|
||||||
// cx.simulate_shared_keystrokes(["shift-t", "e"]).await;
|
|
||||||
// cx.assert_shared_state("one two threeˇ four").await;
|
|
||||||
// cx.simulate_shared_keystrokes(["3", ";"]).await;
|
|
||||||
// cx.assert_shared_state("oneˇ two three four").await;
|
|
||||||
// cx.simulate_shared_keystrokes([","]).await;
|
|
||||||
// cx.assert_shared_state("one two thˇree four").await;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// #[gpui::test]
|
third and
|
||||||
// async fn test_next_line_start(cx: &mut gpui::TestAppContext) {
|
final"})
|
||||||
// let mut cx = NeovimBackedTestContext::new(cx).await;
|
.await
|
||||||
// cx.set_shared_state("ˇone\n two\nthree").await;
|
}
|
||||||
// cx.simulate_shared_keystrokes(["enter"]).await;
|
|
||||||
// cx.assert_shared_state("one\n ˇtwo\nthree").await;
|
#[gpui::test]
|
||||||
// }
|
async fn test_matching(cx: &mut gpui::TestAppContext) {
|
||||||
// }
|
let mut cx = NeovimBackedTestContext::new(cx).await;
|
||||||
|
|
||||||
|
cx.set_shared_state(indoc! {r"func ˇ(a string) {
|
||||||
|
do(something(with<Types>.and_arrays[0, 2]))
|
||||||
|
}"})
|
||||||
|
.await;
|
||||||
|
cx.simulate_shared_keystrokes(["%"]).await;
|
||||||
|
cx.assert_shared_state(indoc! {r"func (a stringˇ) {
|
||||||
|
do(something(with<Types>.and_arrays[0, 2]))
|
||||||
|
}"})
|
||||||
|
.await;
|
||||||
|
|
||||||
|
// test it works on the last character of the line
|
||||||
|
cx.set_shared_state(indoc! {r"func (a string) ˇ{
|
||||||
|
do(something(with<Types>.and_arrays[0, 2]))
|
||||||
|
}"})
|
||||||
|
.await;
|
||||||
|
cx.simulate_shared_keystrokes(["%"]).await;
|
||||||
|
cx.assert_shared_state(indoc! {r"func (a string) {
|
||||||
|
do(something(with<Types>.and_arrays[0, 2]))
|
||||||
|
ˇ}"})
|
||||||
|
.await;
|
||||||
|
|
||||||
|
// test it works on immediate nesting
|
||||||
|
cx.set_shared_state("ˇ{()}").await;
|
||||||
|
cx.simulate_shared_keystrokes(["%"]).await;
|
||||||
|
cx.assert_shared_state("{()ˇ}").await;
|
||||||
|
cx.simulate_shared_keystrokes(["%"]).await;
|
||||||
|
cx.assert_shared_state("ˇ{()}").await;
|
||||||
|
|
||||||
|
// test it works on immediate nesting inside braces
|
||||||
|
cx.set_shared_state("{\n ˇ{()}\n}").await;
|
||||||
|
cx.simulate_shared_keystrokes(["%"]).await;
|
||||||
|
cx.assert_shared_state("{\n {()ˇ}\n}").await;
|
||||||
|
|
||||||
|
// test it jumps to the next paren on a line
|
||||||
|
cx.set_shared_state("func ˇboop() {\n}").await;
|
||||||
|
cx.simulate_shared_keystrokes(["%"]).await;
|
||||||
|
cx.assert_shared_state("func boop(ˇ) {\n}").await;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[gpui::test]
|
||||||
|
async fn test_comma_semicolon(cx: &mut gpui::TestAppContext) {
|
||||||
|
let mut cx = NeovimBackedTestContext::new(cx).await;
|
||||||
|
|
||||||
|
cx.set_shared_state("ˇone two three four").await;
|
||||||
|
cx.simulate_shared_keystrokes(["f", "o"]).await;
|
||||||
|
cx.assert_shared_state("one twˇo three four").await;
|
||||||
|
cx.simulate_shared_keystrokes([","]).await;
|
||||||
|
cx.assert_shared_state("ˇone two three four").await;
|
||||||
|
cx.simulate_shared_keystrokes(["2", ";"]).await;
|
||||||
|
cx.assert_shared_state("one two three fˇour").await;
|
||||||
|
cx.simulate_shared_keystrokes(["shift-t", "e"]).await;
|
||||||
|
cx.assert_shared_state("one two threeˇ four").await;
|
||||||
|
cx.simulate_shared_keystrokes(["3", ";"]).await;
|
||||||
|
cx.assert_shared_state("oneˇ two three four").await;
|
||||||
|
cx.simulate_shared_keystrokes([","]).await;
|
||||||
|
cx.assert_shared_state("one two thˇree four").await;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[gpui::test]
|
||||||
|
async fn test_next_line_start(cx: &mut gpui::TestAppContext) {
|
||||||
|
let mut cx = NeovimBackedTestContext::new(cx).await;
|
||||||
|
cx.set_shared_state("ˇone\n two\nthree").await;
|
||||||
|
cx.simulate_shared_keystrokes(["enter"]).await;
|
||||||
|
cx.assert_shared_state("one\n ˇtwo\nthree").await;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -74,43 +74,43 @@ pub fn change_case(_: &mut Workspace, _: &ChangeCase, cx: &mut ViewContext<Works
|
||||||
vim.switch_mode(Mode::Normal, true, cx)
|
vim.switch_mode(Mode::Normal, true, cx)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// #[cfg(test)]
|
#[cfg(test)]
|
||||||
// mod test {
|
mod test {
|
||||||
// use crate::{state::Mode, test::NeovimBackedTestContext};
|
use crate::{state::Mode, test::NeovimBackedTestContext};
|
||||||
|
|
||||||
// #[gpui::test]
|
#[gpui::test]
|
||||||
// async fn test_change_case(cx: &mut gpui::TestAppContext) {
|
async fn test_change_case(cx: &mut gpui::TestAppContext) {
|
||||||
// let mut cx = NeovimBackedTestContext::new(cx).await;
|
let mut cx = NeovimBackedTestContext::new(cx).await;
|
||||||
// cx.set_shared_state("ˇabC\n").await;
|
cx.set_shared_state("ˇabC\n").await;
|
||||||
// cx.simulate_shared_keystrokes(["~"]).await;
|
cx.simulate_shared_keystrokes(["~"]).await;
|
||||||
// cx.assert_shared_state("AˇbC\n").await;
|
cx.assert_shared_state("AˇbC\n").await;
|
||||||
// cx.simulate_shared_keystrokes(["2", "~"]).await;
|
cx.simulate_shared_keystrokes(["2", "~"]).await;
|
||||||
// cx.assert_shared_state("ABˇc\n").await;
|
cx.assert_shared_state("ABˇc\n").await;
|
||||||
|
|
||||||
// // works in visual mode
|
// works in visual mode
|
||||||
// cx.set_shared_state("a😀C«dÉ1*fˇ»\n").await;
|
cx.set_shared_state("a😀C«dÉ1*fˇ»\n").await;
|
||||||
// cx.simulate_shared_keystrokes(["~"]).await;
|
cx.simulate_shared_keystrokes(["~"]).await;
|
||||||
// cx.assert_shared_state("a😀CˇDé1*F\n").await;
|
cx.assert_shared_state("a😀CˇDé1*F\n").await;
|
||||||
|
|
||||||
// // works with multibyte characters
|
// works with multibyte characters
|
||||||
// cx.simulate_shared_keystrokes(["~"]).await;
|
cx.simulate_shared_keystrokes(["~"]).await;
|
||||||
// cx.set_shared_state("aˇC😀é1*F\n").await;
|
cx.set_shared_state("aˇC😀é1*F\n").await;
|
||||||
// cx.simulate_shared_keystrokes(["4", "~"]).await;
|
cx.simulate_shared_keystrokes(["4", "~"]).await;
|
||||||
// cx.assert_shared_state("ac😀É1ˇ*F\n").await;
|
cx.assert_shared_state("ac😀É1ˇ*F\n").await;
|
||||||
|
|
||||||
// // works with line selections
|
// works with line selections
|
||||||
// cx.set_shared_state("abˇC\n").await;
|
cx.set_shared_state("abˇC\n").await;
|
||||||
// cx.simulate_shared_keystrokes(["shift-v", "~"]).await;
|
cx.simulate_shared_keystrokes(["shift-v", "~"]).await;
|
||||||
// cx.assert_shared_state("ˇABc\n").await;
|
cx.assert_shared_state("ˇABc\n").await;
|
||||||
|
|
||||||
// // works in visual block mode
|
// works in visual block mode
|
||||||
// cx.set_shared_state("ˇaa\nbb\ncc").await;
|
cx.set_shared_state("ˇaa\nbb\ncc").await;
|
||||||
// cx.simulate_shared_keystrokes(["ctrl-v", "j", "~"]).await;
|
cx.simulate_shared_keystrokes(["ctrl-v", "j", "~"]).await;
|
||||||
// cx.assert_shared_state("ˇAa\nBb\ncc").await;
|
cx.assert_shared_state("ˇAa\nBb\ncc").await;
|
||||||
|
|
||||||
// // works with multiple cursors (zed only)
|
// works with multiple cursors (zed only)
|
||||||
// cx.set_state("aˇßcdˇe\n", Mode::Normal);
|
cx.set_state("aˇßcdˇe\n", Mode::Normal);
|
||||||
// cx.simulate_keystroke("~");
|
cx.simulate_keystroke("~");
|
||||||
// cx.assert_state("aSSˇcdˇE\n", Mode::Normal);
|
cx.assert_state("aSSˇcdˇE\n", Mode::Normal);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue