25 lines
760 B
Rust
25 lines
760 B
Rust
use std::process::Command;
|
|
|
|
#[test]
|
|
fn conversion_failure_leaves_no_output() {
|
|
let dir = std::env::temp_dir().join(format!("tbc-convert-{}", std::process::id()));
|
|
std::fs::create_dir_all(&dir).unwrap();
|
|
let input = dir.join("broken.frm");
|
|
let output = dir.join("converted.frm");
|
|
std::fs::write(&input, b"not a form").unwrap();
|
|
|
|
let result = Command::new(env!("CARGO_BIN_EXE_tbc"))
|
|
.args([
|
|
"convert-frm",
|
|
input.to_str().unwrap(),
|
|
output.to_str().unwrap(),
|
|
])
|
|
.output()
|
|
.unwrap();
|
|
|
|
assert!(!result.status.success());
|
|
assert!(!output.exists());
|
|
assert!(String::from_utf8_lossy(&result.stderr).contains("0x0000"));
|
|
std::fs::remove_dir_all(dir).unwrap();
|
|
}
|