MOAR TESTS
This commit is contained in:
@@ -173,106 +173,106 @@ fn find_number(
|
||||
}
|
||||
}
|
||||
|
||||
// #[cfg(test)]
|
||||
// mod test {
|
||||
// use indoc::indoc;
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use indoc::indoc;
|
||||
|
||||
// use crate::test::NeovimBackedTestContext;
|
||||
use crate::test::NeovimBackedTestContext;
|
||||
|
||||
// #[gpui::test]
|
||||
// async fn test_increment(cx: &mut gpui::TestAppContext) {
|
||||
// let mut cx = NeovimBackedTestContext::new(cx).await;
|
||||
#[gpui::test]
|
||||
async fn test_increment(cx: &mut gpui::TestAppContext) {
|
||||
let mut cx = NeovimBackedTestContext::new(cx).await;
|
||||
|
||||
// cx.set_shared_state(indoc! {"
|
||||
// 1ˇ2
|
||||
// "})
|
||||
// .await;
|
||||
cx.set_shared_state(indoc! {"
|
||||
1ˇ2
|
||||
"})
|
||||
.await;
|
||||
|
||||
// cx.simulate_shared_keystrokes(["ctrl-a"]).await;
|
||||
// cx.assert_shared_state(indoc! {"
|
||||
// 1ˇ3
|
||||
// "})
|
||||
// .await;
|
||||
// cx.simulate_shared_keystrokes(["ctrl-x"]).await;
|
||||
// cx.assert_shared_state(indoc! {"
|
||||
// 1ˇ2
|
||||
// "})
|
||||
// .await;
|
||||
cx.simulate_shared_keystrokes(["ctrl-a"]).await;
|
||||
cx.assert_shared_state(indoc! {"
|
||||
1ˇ3
|
||||
"})
|
||||
.await;
|
||||
cx.simulate_shared_keystrokes(["ctrl-x"]).await;
|
||||
cx.assert_shared_state(indoc! {"
|
||||
1ˇ2
|
||||
"})
|
||||
.await;
|
||||
|
||||
// cx.simulate_shared_keystrokes(["9", "9", "ctrl-a"]).await;
|
||||
// cx.assert_shared_state(indoc! {"
|
||||
// 11ˇ1
|
||||
// "})
|
||||
// .await;
|
||||
// cx.simulate_shared_keystrokes(["1", "1", "1", "ctrl-x"])
|
||||
// .await;
|
||||
// cx.assert_shared_state(indoc! {"
|
||||
// ˇ0
|
||||
// "})
|
||||
// .await;
|
||||
// cx.simulate_shared_keystrokes(["."]).await;
|
||||
// cx.assert_shared_state(indoc! {"
|
||||
// -11ˇ1
|
||||
// "})
|
||||
// .await;
|
||||
// }
|
||||
cx.simulate_shared_keystrokes(["9", "9", "ctrl-a"]).await;
|
||||
cx.assert_shared_state(indoc! {"
|
||||
11ˇ1
|
||||
"})
|
||||
.await;
|
||||
cx.simulate_shared_keystrokes(["1", "1", "1", "ctrl-x"])
|
||||
.await;
|
||||
cx.assert_shared_state(indoc! {"
|
||||
ˇ0
|
||||
"})
|
||||
.await;
|
||||
cx.simulate_shared_keystrokes(["."]).await;
|
||||
cx.assert_shared_state(indoc! {"
|
||||
-11ˇ1
|
||||
"})
|
||||
.await;
|
||||
}
|
||||
|
||||
// #[gpui::test]
|
||||
// async fn test_increment_radix(cx: &mut gpui::TestAppContext) {
|
||||
// let mut cx = NeovimBackedTestContext::new(cx).await;
|
||||
#[gpui::test]
|
||||
async fn test_increment_radix(cx: &mut gpui::TestAppContext) {
|
||||
let mut cx = NeovimBackedTestContext::new(cx).await;
|
||||
|
||||
// cx.assert_matches_neovim("ˇ total: 0xff", ["ctrl-a"], " total: 0x10ˇ0")
|
||||
// .await;
|
||||
// cx.assert_matches_neovim("ˇ total: 0xff", ["ctrl-x"], " total: 0xfˇe")
|
||||
// .await;
|
||||
// cx.assert_matches_neovim("ˇ total: 0xFF", ["ctrl-x"], " total: 0xFˇE")
|
||||
// .await;
|
||||
// cx.assert_matches_neovim("(ˇ0b10f)", ["ctrl-a"], "(0b1ˇ1f)")
|
||||
// .await;
|
||||
// cx.assert_matches_neovim("ˇ-1", ["ctrl-a"], "ˇ0").await;
|
||||
// cx.assert_matches_neovim("banˇana", ["ctrl-a"], "banˇana")
|
||||
// .await;
|
||||
// }
|
||||
cx.assert_matches_neovim("ˇ total: 0xff", ["ctrl-a"], " total: 0x10ˇ0")
|
||||
.await;
|
||||
cx.assert_matches_neovim("ˇ total: 0xff", ["ctrl-x"], " total: 0xfˇe")
|
||||
.await;
|
||||
cx.assert_matches_neovim("ˇ total: 0xFF", ["ctrl-x"], " total: 0xFˇE")
|
||||
.await;
|
||||
cx.assert_matches_neovim("(ˇ0b10f)", ["ctrl-a"], "(0b1ˇ1f)")
|
||||
.await;
|
||||
cx.assert_matches_neovim("ˇ-1", ["ctrl-a"], "ˇ0").await;
|
||||
cx.assert_matches_neovim("banˇana", ["ctrl-a"], "banˇana")
|
||||
.await;
|
||||
}
|
||||
|
||||
// #[gpui::test]
|
||||
// async fn test_increment_steps(cx: &mut gpui::TestAppContext) {
|
||||
// let mut cx = NeovimBackedTestContext::new(cx).await;
|
||||
#[gpui::test]
|
||||
async fn test_increment_steps(cx: &mut gpui::TestAppContext) {
|
||||
let mut cx = NeovimBackedTestContext::new(cx).await;
|
||||
|
||||
// cx.set_shared_state(indoc! {"
|
||||
// ˇ1
|
||||
// 1
|
||||
// 1 2
|
||||
// 1
|
||||
// 1"})
|
||||
// .await;
|
||||
cx.set_shared_state(indoc! {"
|
||||
ˇ1
|
||||
1
|
||||
1 2
|
||||
1
|
||||
1"})
|
||||
.await;
|
||||
|
||||
// cx.simulate_shared_keystrokes(["j", "v", "shift-g", "g", "ctrl-a"])
|
||||
// .await;
|
||||
// cx.assert_shared_state(indoc! {"
|
||||
// 1
|
||||
// ˇ2
|
||||
// 3 2
|
||||
// 4
|
||||
// 5"})
|
||||
// .await;
|
||||
cx.simulate_shared_keystrokes(["j", "v", "shift-g", "g", "ctrl-a"])
|
||||
.await;
|
||||
cx.assert_shared_state(indoc! {"
|
||||
1
|
||||
ˇ2
|
||||
3 2
|
||||
4
|
||||
5"})
|
||||
.await;
|
||||
|
||||
// cx.simulate_shared_keystrokes(["shift-g", "ctrl-v", "g", "g"])
|
||||
// .await;
|
||||
// cx.assert_shared_state(indoc! {"
|
||||
// «1ˇ»
|
||||
// «2ˇ»
|
||||
// «3ˇ» 2
|
||||
// «4ˇ»
|
||||
// «5ˇ»"})
|
||||
// .await;
|
||||
cx.simulate_shared_keystrokes(["shift-g", "ctrl-v", "g", "g"])
|
||||
.await;
|
||||
cx.assert_shared_state(indoc! {"
|
||||
«1ˇ»
|
||||
«2ˇ»
|
||||
«3ˇ» 2
|
||||
«4ˇ»
|
||||
«5ˇ»"})
|
||||
.await;
|
||||
|
||||
// cx.simulate_shared_keystrokes(["g", "ctrl-x"]).await;
|
||||
// cx.assert_shared_state(indoc! {"
|
||||
// ˇ0
|
||||
// 0
|
||||
// 0 2
|
||||
// 0
|
||||
// 0"})
|
||||
// .await;
|
||||
// }
|
||||
// }
|
||||
cx.simulate_shared_keystrokes(["g", "ctrl-x"]).await;
|
||||
cx.assert_shared_state(indoc! {"
|
||||
ˇ0
|
||||
0
|
||||
0 2
|
||||
0
|
||||
0"})
|
||||
.await;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user