From f486f34ebe0e21f0e109e24037e73182b2cf510a Mon Sep 17 00:00:00 2001 From: Skyler Hawthorne Date: Fri, 21 Oct 2022 00:28:29 -0400 Subject: 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.--- helix-term/tests/test/auto_pairs.rs | 50 ++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'helix-term/tests/test/auto_pairs.rs') diff --git a/helix-term/tests/test/auto_pairs.rs b/helix-term/tests/test/auto_pairs.rs index f2ab49c7..e18c7119 100644 --- a/helix-term/tests/test/auto_pairs.rs +++ b/helix-term/tests/test/auto_pairs.rs @@ -12,7 +12,7 @@ fn matching_pairs() -> impl Iterator { DEFAULT_PAIRS.iter().filter(|(open, close)| open == close) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn insert_basic() -> anyhow::Result<()> { for pair in DEFAULT_PAIRS { test(( @@ -26,7 +26,7 @@ async fn insert_basic() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn insert_configured_multi_byte_chars() -> anyhow::Result<()> { // NOTE: these are multi-byte Unicode characters let pairs = hashmap!('„' => '“', '‚' => '‘', '「' => '」'); @@ -68,7 +68,7 @@ async fn insert_configured_multi_byte_chars() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn insert_after_word() -> anyhow::Result<()> { for pair in differing_pairs() { test(( @@ -91,7 +91,7 @@ async fn insert_after_word() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn insert_before_word() -> anyhow::Result<()> { for pair in DEFAULT_PAIRS { test(( @@ -105,7 +105,7 @@ async fn insert_before_word() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn insert_before_word_selection() -> anyhow::Result<()> { for pair in DEFAULT_PAIRS { test(( @@ -119,7 +119,7 @@ async fn insert_before_word_selection() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn insert_before_word_selection_trailing_word() -> anyhow::Result<()> { for pair in differing_pairs() { test(( @@ -133,7 +133,7 @@ async fn insert_before_word_selection_trailing_word() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn insert_closer_selection_trailing_word() -> anyhow::Result<()> { for pair in differing_pairs() { test(( @@ -147,7 +147,7 @@ async fn insert_closer_selection_trailing_word() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn insert_before_eol() -> anyhow::Result<()> { for pair in DEFAULT_PAIRS { test(( @@ -166,7 +166,7 @@ async fn insert_before_eol() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn insert_auto_pairs_disabled() -> anyhow::Result<()> { for pair in DEFAULT_PAIRS { test_with_config( @@ -191,7 +191,7 @@ async fn insert_auto_pairs_disabled() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn insert_multi_range() -> anyhow::Result<()> { for pair in DEFAULT_PAIRS { test(( @@ -210,7 +210,7 @@ async fn insert_multi_range() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn insert_before_multi_code_point_graphemes() -> anyhow::Result<()> { for pair in differing_pairs() { test(( @@ -223,7 +223,7 @@ async fn insert_before_multi_code_point_graphemes() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn insert_at_end_of_document() -> anyhow::Result<()> { for pair in DEFAULT_PAIRS { test(TestCase { @@ -248,7 +248,7 @@ async fn insert_at_end_of_document() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn insert_close_inside_pair() -> anyhow::Result<()> { for pair in DEFAULT_PAIRS { test(( @@ -272,7 +272,7 @@ async fn insert_close_inside_pair() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn insert_close_inside_pair_multi() -> anyhow::Result<()> { for pair in DEFAULT_PAIRS { test(( @@ -296,7 +296,7 @@ async fn insert_close_inside_pair_multi() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn insert_nested_open_inside_pair() -> anyhow::Result<()> { for pair in differing_pairs() { test(( @@ -320,7 +320,7 @@ async fn insert_nested_open_inside_pair() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn insert_nested_open_inside_pair_multi() -> anyhow::Result<()> { for outer_pair in DEFAULT_PAIRS { for inner_pair in DEFAULT_PAIRS { @@ -352,7 +352,7 @@ async fn insert_nested_open_inside_pair_multi() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn append_basic() -> anyhow::Result<()> { for pair in DEFAULT_PAIRS { test(( @@ -371,7 +371,7 @@ async fn append_basic() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn append_multi_range() -> anyhow::Result<()> { for pair in DEFAULT_PAIRS { test(( @@ -390,7 +390,7 @@ async fn append_multi_range() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn append_close_inside_pair() -> anyhow::Result<()> { for pair in DEFAULT_PAIRS { test(( @@ -414,7 +414,7 @@ async fn append_close_inside_pair() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn append_close_inside_pair_multi() -> anyhow::Result<()> { for pair in DEFAULT_PAIRS { test(( @@ -438,7 +438,7 @@ async fn append_close_inside_pair_multi() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn append_end_of_word() -> anyhow::Result<()> { for pair in differing_pairs() { test(( @@ -457,7 +457,7 @@ async fn append_end_of_word() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn append_middle_of_word() -> anyhow::Result<()> { for pair in differing_pairs() { test(( @@ -471,7 +471,7 @@ async fn append_middle_of_word() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn append_end_of_word_multi() -> anyhow::Result<()> { for pair in differing_pairs() { test(( @@ -490,7 +490,7 @@ async fn append_end_of_word_multi() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn append_inside_nested_pair() -> anyhow::Result<()> { for pair in differing_pairs() { test(( @@ -514,7 +514,7 @@ async fn append_inside_nested_pair() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn append_inside_nested_pair_multi() -> anyhow::Result<()> { for outer_pair in DEFAULT_PAIRS { for inner_pair in DEFAULT_PAIRS { -- cgit v1.2.3-70-g09d2