@@ -14,13 +14,7 @@ async fn test_write() -> anyhow::Result<()> {
1414 let mut file = tempfile::NamedTempFile::new()?;
1515
1616 test_key_sequence(
17− &mut Application::new(
18− Args {
19− files: vec![(file.path().to_path_buf(), Position::default())],
20− ..Default::default()
21− },
22− Config::default(),
23− )?,
17+ &mut helpers::app_with_file(file.path())?,
2418 Some("ii can eat glass, it will not hurt me<ret><esc>:w<ret>"),
2519 None,
2620 false,
@@ -46,13 +40,7 @@ async fn test_write_quit() -> anyhow::Result<()> {
4640 let mut file = tempfile::NamedTempFile::new()?;
4741
4842 test_key_sequence(
49− &mut Application::new(
50− Args {
51− files: vec![(file.path().to_path_buf(), Position::default())],
52− ..Default::default()
53− },
54− Config::default(),
55− )?,
43+ &mut helpers::app_with_file(file.path())?,
5644 Some("ii can eat glass, it will not hurt me<ret><esc>:wq<ret>"),
5745 None,
5846 true,
@@ -86,13 +74,7 @@ async fn test_write_concurrent() -> anyhow::Result<()> {
8674 }
8775
8876 test_key_sequence(
89− &mut Application::new(
90− Args {
91− files: vec![(file.path().to_path_buf(), Position::default())],
92− ..Default::default()
93− },
94− Config::default(),
95− )?,
77+ &mut helpers::app_with_file(file.path())?,
9678 Some(&command),
9779 None,
9880 false,
@@ -115,13 +97,7 @@ async fn test_write_fail_mod_flag() -> anyhow::Result<()> {
11597 let file = helpers::new_readonly_tempfile()?;
11698
11799 test_key_sequences(
118− &mut Application::new(
119− Args {
120− files: vec![(file.path().to_path_buf(), Position::default())],
121− ..Default::default()
122− },
123− Config::default(),
124− )?,
100+ &mut helpers::app_with_file(file.path())?,
125101 vec![
126102 (
127103 None,