diff options
author | Skyler Hawthorne | 2022-10-21 04:28:29 +0000 |
---|---|---|
committer | GitHub | 2022-10-21 04:28:29 +0000 |
commit | f486f34ebe0e21f0e109e24037e73182b2cf510a (patch) | |
tree | 4aaf5b05d037b05a9a0b3be6eb7d6634eec98d12 /helix-term/tests/test/write.rs | |
parent | 74a6a2282e79190baa59cd52907e014b31331819 (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/write.rs')
-rw-r--r-- | helix-term/tests/test/write.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/helix-term/tests/test/write.rs b/helix-term/tests/test/write.rs index 6aa51a31..d0128edc 100644 --- a/helix-term/tests/test/write.rs +++ b/helix-term/tests/test/write.rs @@ -8,7 +8,7 @@ use helix_view::doc; use super::*; -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn test_write() -> anyhow::Result<()> { let mut file = tempfile::NamedTempFile::new()?; let mut app = helpers::AppBuilder::new() @@ -92,7 +92,7 @@ async fn test_write_concurrent() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn test_write_fail_mod_flag() -> anyhow::Result<()> { let file = helpers::new_readonly_tempfile()?; let mut app = helpers::AppBuilder::new() @@ -133,7 +133,7 @@ async fn test_write_fail_mod_flag() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn test_write_scratch_to_new_path() -> anyhow::Result<()> { let mut file = tempfile::NamedTempFile::new()?; @@ -158,7 +158,7 @@ async fn test_write_scratch_to_new_path() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn test_write_scratch_no_path_fails() -> anyhow::Result<()> { helpers::test_key_sequence_with_input_text( None, @@ -179,7 +179,7 @@ async fn test_write_scratch_no_path_fails() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn test_write_auto_format_fails_still_writes() -> anyhow::Result<()> { let mut file = tempfile::Builder::new().suffix(".rs").tempfile()?; @@ -203,7 +203,7 @@ async fn test_write_auto_format_fails_still_writes() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn test_write_new_path() -> anyhow::Result<()> { let mut file1 = tempfile::NamedTempFile::new().unwrap(); let mut file2 = tempfile::NamedTempFile::new().unwrap(); @@ -249,7 +249,7 @@ async fn test_write_new_path() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn test_write_fail_new_path() -> anyhow::Result<()> { let file = helpers::new_readonly_tempfile()?; |