|
|
@ -14,13 +14,7 @@ async fn test_write() -> anyhow::Result<()> {
|
|
|
|
let mut file = tempfile::NamedTempFile::new()?;
|
|
|
|
let mut file = tempfile::NamedTempFile::new()?;
|
|
|
|
|
|
|
|
|
|
|
|
test_key_sequence(
|
|
|
|
test_key_sequence(
|
|
|
|
&mut Application::new(
|
|
|
|
&mut helpers::app_with_file(file.path())?,
|
|
|
|
Args {
|
|
|
|
|
|
|
|
files: vec![(file.path().to_path_buf(), Position::default())],
|
|
|
|
|
|
|
|
..Default::default()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
Config::default(),
|
|
|
|
|
|
|
|
)?,
|
|
|
|
|
|
|
|
Some("ii can eat glass, it will not hurt me<ret><esc>:w<ret>"),
|
|
|
|
Some("ii can eat glass, it will not hurt me<ret><esc>:w<ret>"),
|
|
|
|
None,
|
|
|
|
None,
|
|
|
|
false,
|
|
|
|
false,
|
|
|
@ -46,13 +40,7 @@ async fn test_write_quit() -> anyhow::Result<()> {
|
|
|
|
let mut file = tempfile::NamedTempFile::new()?;
|
|
|
|
let mut file = tempfile::NamedTempFile::new()?;
|
|
|
|
|
|
|
|
|
|
|
|
test_key_sequence(
|
|
|
|
test_key_sequence(
|
|
|
|
&mut Application::new(
|
|
|
|
&mut helpers::app_with_file(file.path())?,
|
|
|
|
Args {
|
|
|
|
|
|
|
|
files: vec![(file.path().to_path_buf(), Position::default())],
|
|
|
|
|
|
|
|
..Default::default()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
Config::default(),
|
|
|
|
|
|
|
|
)?,
|
|
|
|
|
|
|
|
Some("ii can eat glass, it will not hurt me<ret><esc>:wq<ret>"),
|
|
|
|
Some("ii can eat glass, it will not hurt me<ret><esc>:wq<ret>"),
|
|
|
|
None,
|
|
|
|
None,
|
|
|
|
true,
|
|
|
|
true,
|
|
|
@ -86,13 +74,7 @@ async fn test_write_concurrent() -> anyhow::Result<()> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
test_key_sequence(
|
|
|
|
test_key_sequence(
|
|
|
|
&mut Application::new(
|
|
|
|
&mut helpers::app_with_file(file.path())?,
|
|
|
|
Args {
|
|
|
|
|
|
|
|
files: vec![(file.path().to_path_buf(), Position::default())],
|
|
|
|
|
|
|
|
..Default::default()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
Config::default(),
|
|
|
|
|
|
|
|
)?,
|
|
|
|
|
|
|
|
Some(&command),
|
|
|
|
Some(&command),
|
|
|
|
None,
|
|
|
|
None,
|
|
|
|
false,
|
|
|
|
false,
|
|
|
@ -115,13 +97,7 @@ async fn test_write_fail_mod_flag() -> anyhow::Result<()> {
|
|
|
|
let file = helpers::new_readonly_tempfile()?;
|
|
|
|
let file = helpers::new_readonly_tempfile()?;
|
|
|
|
|
|
|
|
|
|
|
|
test_key_sequences(
|
|
|
|
test_key_sequences(
|
|
|
|
&mut Application::new(
|
|
|
|
&mut helpers::app_with_file(file.path())?,
|
|
|
|
Args {
|
|
|
|
|
|
|
|
files: vec![(file.path().to_path_buf(), Position::default())],
|
|
|
|
|
|
|
|
..Default::default()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
Config::default(),
|
|
|
|
|
|
|
|
)?,
|
|
|
|
|
|
|
|
vec![
|
|
|
|
vec![
|
|
|
|
(
|
|
|
|
(
|
|
|
|
None,
|
|
|
|
None,
|
|
|
|