diff options
Diffstat (limited to 'tests/test_cli.rs')
-rw-r--r-- | tests/test_cli.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/test_cli.rs b/tests/test_cli.rs index b247ad5..3cac0f5 100644 --- a/tests/test_cli.rs +++ b/tests/test_cli.rs @@ -5,7 +5,7 @@ use fixtures::*; use assert_cmd::prelude::*; use std::fs; use std::fs::File; -use std::io::Read; +use std::io::{Read, Write}; use std::process::Command; use tempfile::tempdir; @@ -45,6 +45,21 @@ fn test_it_refuses_to_overwrite_directory() { } #[test] +fn test_non_mft_file_is_error() { + let d = tempdir().unwrap(); + + let f = d.as_ref().join("test.out"); + + let mut file = File::create(&f).unwrap(); + file.write_all(b"I'm a file!").unwrap(); + + let mut cmd = Command::cargo_bin("mft_dump").expect("failed to find binary"); + cmd.args(&[f.to_str().unwrap()]); + + cmd.assert().failure().code(1); +} + +#[test] fn test_it_exports_resident_streams() { let d = tempdir().unwrap(); |