diff options
Diffstat (limited to 'tests/cli.rs')
-rw-r--r-- | tests/cli.rs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/cli.rs b/tests/cli.rs index 420eca4..7d95411 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -25,13 +25,26 @@ fn in_place() -> Result<()> { } #[test] +fn in_place_with_empty_result_file() -> Result<()> { + let mut file = tempfile::NamedTempFile::new()?; + file.write(b"a7c")?; + let path = file.into_temp_path(); + + sd().args(&["a\\dc", "", path.to_str().unwrap()]) + .assert() + .success(); + assert_file(&path.to_path_buf(), ""); + + Ok(()) +} + +#[test] fn replace_into_stdout() -> Result<()> { let mut file = tempfile::NamedTempFile::new()?; file.write(b"abc123def")?; #[rustfmt::skip] - sd() - .args(&["-p", "abc\\d+", "", file.path().to_str().unwrap()]) + sd().args(&["-p", "abc\\d+", "", file.path().to_str().unwrap()]) .assert() .success() .stdout("def"); |