diff options
author | Skyler Hawthorne | 2022-06-11 03:35:34 +0000 |
---|---|---|
committer | Skyler Hawthorne | 2022-06-19 04:00:31 +0000 |
commit | 665286c199b344c0bd65772156b5e460ff11d768 (patch) | |
tree | ea11016ae97144d4424bfbd4ec4d971d152493ea /helix-term/tests/test/commands.rs | |
parent | 65bf6836b71e309a43d39b75a3fac7446604592b (diff) |
factor new Application with file arg to function
Diffstat (limited to 'helix-term/tests/test/commands.rs')
-rw-r--r-- | helix-term/tests/test/commands.rs | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/helix-term/tests/test/commands.rs b/helix-term/tests/test/commands.rs index 01f13c5c..0cd79bc7 100644 --- a/helix-term/tests/test/commands.rs +++ b/helix-term/tests/test/commands.rs @@ -13,13 +13,7 @@ async fn test_write_quit_fail() -> anyhow::Result<()> { let file = helpers::new_readonly_tempfile()?; test_key_sequence( - &mut Application::new( - Args { - files: vec![(file.path().to_path_buf(), Position::default())], - ..Default::default() - }, - Config::default(), - )?, + &mut helpers::app_with_file(file.path())?, Some("ihello<esc>:wq<ret>"), Some(&|app| { assert_eq!(&Severity::Error, app.editor.get_status().unwrap().1); @@ -76,13 +70,7 @@ async fn test_buffer_close_concurrent() -> anyhow::Result<()> { command.push_str(":buffer<minus>close<ret>"); test_key_sequence( - &mut Application::new( - Args { - files: vec![(file.path().to_path_buf(), Position::default())], - ..Default::default() - }, - Config::default(), - )?, + &mut helpers::app_with_file(file.path())?, Some(&command), Some(&|app| { assert!(!app.editor.is_err(), "error: {:?}", app.editor.get_status()); |