aboutsummaryrefslogtreecommitdiff
path: root/helix-term/tests/test/write.rs
diff options
context:
space:
mode:
authorSkyler Hawthorne2022-06-11 03:35:34 +0000
committerSkyler Hawthorne2022-06-19 04:00:31 +0000
commit665286c199b344c0bd65772156b5e460ff11d768 (patch)
treeea11016ae97144d4424bfbd4ec4d971d152493ea /helix-term/tests/test/write.rs
parent65bf6836b71e309a43d39b75a3fac7446604592b (diff)
factor new Application with file arg to function
Diffstat (limited to 'helix-term/tests/test/write.rs')
-rw-r--r--helix-term/tests/test/write.rs32
1 files changed, 4 insertions, 28 deletions
diff --git a/helix-term/tests/test/write.rs b/helix-term/tests/test/write.rs
index d22b3125..39efa2ce 100644
--- a/helix-term/tests/test/write.rs
+++ b/helix-term/tests/test/write.rs
@@ -14,13 +14,7 @@ async fn test_write() -> anyhow::Result<()> {
let mut file = tempfile::NamedTempFile::new()?;
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("ii can eat glass, it will not hurt me<ret><esc>:w<ret>"),
None,
false,
@@ -46,13 +40,7 @@ async fn test_write_quit() -> anyhow::Result<()> {
let mut file = tempfile::NamedTempFile::new()?;
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("ii can eat glass, it will not hurt me<ret><esc>:wq<ret>"),
None,
true,
@@ -86,13 +74,7 @@ async fn test_write_concurrent() -> anyhow::Result<()> {
}
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),
None,
false,
@@ -115,13 +97,7 @@ async fn test_write_fail_mod_flag() -> anyhow::Result<()> {
let file = helpers::new_readonly_tempfile()?;
test_key_sequences(
- &mut Application::new(
- Args {
- files: vec![(file.path().to_path_buf(), Position::default())],
- ..Default::default()
- },
- Config::default(),
- )?,
+ &mut helpers::app_with_file(file.path())?,
vec![
(
None,