aboutsummaryrefslogtreecommitdiff
path: root/helix-term/tests/test/commands.rs
diff options
context:
space:
mode:
authorSkyler Hawthorne2022-09-17 03:17:48 +0000
committerSkyler Hawthorne2022-10-19 02:31:39 +0000
commit3f07885b351748c5b8225aadb165f8ef7066f047 (patch)
tree37ece44a32184a6902fccdab77adaf13713917bc /helix-term/tests/test/commands.rs
parentb530a86d1f15cc7df0e1ae8aa4bd02109ac33a8f (diff)
document should save even if formatter fails
Diffstat (limited to 'helix-term/tests/test/commands.rs')
-rw-r--r--helix-term/tests/test/commands.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/helix-term/tests/test/commands.rs b/helix-term/tests/test/commands.rs
index 0279e348..5238cc69 100644
--- a/helix-term/tests/test/commands.rs
+++ b/helix-term/tests/test/commands.rs
@@ -1,16 +1,18 @@
use std::ops::RangeInclusive;
use helix_core::diagnostic::Severity;
-use helix_term::application::Application;
use super::*;
#[tokio::test(flavor = "multi_thread")]
async fn test_write_quit_fail() -> anyhow::Result<()> {
let file = helpers::new_readonly_tempfile()?;
+ let mut app = helpers::AppBuilder::new()
+ .with_file(file.path(), None)
+ .build()?;
test_key_sequence(
- &mut helpers::app_with_file(file.path())?,
+ &mut app,
Some("ihello<esc>:wq<ret>"),
Some(&|app| {
let mut docs: Vec<_> = app.editor.documents().collect();
@@ -30,7 +32,7 @@ async fn test_write_quit_fail() -> anyhow::Result<()> {
#[tokio::test(flavor = "multi_thread")]
async fn test_buffer_close_concurrent() -> anyhow::Result<()> {
test_key_sequences(
- &mut Application::new(Args::default(), Config::default())?,
+ &mut helpers::AppBuilder::new().build()?,
vec![
(
None,
@@ -70,8 +72,12 @@ async fn test_buffer_close_concurrent() -> anyhow::Result<()> {
command.push_str(":buffer<minus>close<ret>");
+ let mut app = helpers::AppBuilder::new()
+ .with_file(file.path(), None)
+ .build()?;
+
test_key_sequence(
- &mut helpers::app_with_file(file.path())?,
+ &mut app,
Some(&command),
Some(&|app| {
assert!(!app.editor.is_err(), "error: {:?}", app.editor.get_status());