aboutsummaryrefslogtreecommitdiff
path: root/helix-term/tests/test/movement.rs
diff options
context:
space:
mode:
authorSkyler Hawthorne2022-10-21 04:28:29 +0000
committerGitHub2022-10-21 04:28:29 +0000
commitf486f34ebe0e21f0e109e24037e73182b2cf510a (patch)
tree4aaf5b05d037b05a9a0b3be6eb7d6634eec98d12 /helix-term/tests/test/movement.rs
parent74a6a2282e79190baa59cd52907e014b31331819 (diff)
flush writes on force quit (#4397)
When force quitting, we need to block on the pending writes to ensure that write commands succeed before exiting, and also to avoid a crash when all the views are gone before the auto format call returns from the LS.
Diffstat (limited to 'helix-term/tests/test/movement.rs')
-rw-r--r--helix-term/tests/test/movement.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/helix-term/tests/test/movement.rs b/helix-term/tests/test/movement.rs
index 81c66e53..fedf4b0e 100644
--- a/helix-term/tests/test/movement.rs
+++ b/helix-term/tests/test/movement.rs
@@ -1,6 +1,6 @@
use super::*;
-#[tokio::test]
+#[tokio::test(flavor = "multi_thread")]
async fn insert_mode_cursor_position() -> anyhow::Result<()> {
test(TestCase {
in_text: String::new(),
@@ -19,7 +19,7 @@ async fn insert_mode_cursor_position() -> anyhow::Result<()> {
}
/// Range direction is preserved when escaping insert mode to normal
-#[tokio::test]
+#[tokio::test(flavor = "multi_thread")]
async fn insert_to_normal_mode_cursor_position() -> anyhow::Result<()> {
test(("#[f|]#oo\n", "vll<A-;><esc>", "#[|foo]#\n")).await?;
test((
@@ -66,7 +66,7 @@ async fn insert_to_normal_mode_cursor_position() -> anyhow::Result<()> {
/// Ensure the very initial cursor in an opened file is the width of
/// the first grapheme
-#[tokio::test]
+#[tokio::test(flavor = "multi_thread")]
async fn cursor_position_newly_opened_file() -> anyhow::Result<()> {
let test = |content: &str, expected_sel: Selection| -> anyhow::Result<()> {
let file = helpers::temp_file_with_contents(content)?;
@@ -88,7 +88,7 @@ async fn cursor_position_newly_opened_file() -> anyhow::Result<()> {
Ok(())
}
-#[tokio::test]
+#[tokio::test(flavor = "multi_thread")]
async fn cursor_position_append_eof() -> anyhow::Result<()> {
// Selection is fowards
test((
@@ -109,7 +109,7 @@ async fn cursor_position_append_eof() -> anyhow::Result<()> {
Ok(())
}
-#[tokio::test]
+#[tokio::test(flavor = "multi_thread")]
async fn select_mode_tree_sitter_next_function_is_union_of_objects() -> anyhow::Result<()> {
test_with_config(
Args {
@@ -141,7 +141,7 @@ async fn select_mode_tree_sitter_next_function_is_union_of_objects() -> anyhow::
Ok(())
}
-#[tokio::test]
+#[tokio::test(flavor = "multi_thread")]
async fn select_mode_tree_sitter_prev_function_unselects_object() -> anyhow::Result<()> {
test_with_config(
Args {
@@ -173,7 +173,7 @@ async fn select_mode_tree_sitter_prev_function_unselects_object() -> anyhow::Res
Ok(())
}
-#[tokio::test]
+#[tokio::test(flavor = "multi_thread")]
async fn select_mode_tree_sitter_prev_function_goes_backwards_to_object() -> anyhow::Result<()> {
// Note: the anchor stays put and the head moves back.
test_with_config(