(root: &std::path::Path, args: &[&str], succeeds: bool)
| 7 | use atomic_repository::{RecordOptions, Repository}; |
| 8 | |
| 9 | fn run(root: &std::path::Path, args: &[&str], succeeds: bool) -> String { |
| 10 | let output = Command::new(env!("CARGO_BIN_EXE_atomic")) |
| 11 | .args(args) |
| 12 | .current_dir(root) |
| 13 | .stdin(Stdio::null()) |
| 14 | .output() |
| 15 | .unwrap(); |
| 16 | let text = format!( |
| 17 | "{}{}", |
| 18 | String::from_utf8_lossy(&output.stdout), |
| 19 | String::from_utf8_lossy(&output.stderr), |
| 20 | ); |
| 21 | assert_eq!(output.status.success(), succeeds, "{args:?}: {text}"); |
| 22 | text |
| 23 | } |
| 24 | |
| 25 | #[test] |
| 26 | fn split_and_orphaning_delete_require_explicit_confirmation_without_a_terminal() { |
no test coverage detected