helix-mods/helix-term/tests/test/auto_indent.rs
Skyler Hawthorne f486f34ebe
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.
2022-10-21 13:28:29 +09:00

27 lines
668 B
Rust

use super::*;
#[tokio::test(flavor = "multi_thread")]
async fn auto_indent_c() -> anyhow::Result<()> {
test_with_config(
Args {
files: vec![(PathBuf::from("foo.c"), Position::default())],
..Default::default()
},
Config::default(),
helpers::test_syntax_conf(None),
// switches to append mode?
(
helpers::platform_line("void foo() {#[|}]#").as_ref(),
"i<ret><esc>",
helpers::platform_line(indoc! {"\
void foo() {
#[|\n]#\
}
"})
.as_ref(),
),
)
.await?;
Ok(())
}