(root: &Path, args: &[&str], succeeds: bool)
| 11 | use tempfile::TempDir; |
| 12 | |
| 13 | fn run(root: &Path, args: &[&str], succeeds: bool) -> String { |
| 14 | let output = Command::new(env!("CARGO_BIN_EXE_atomic")) |
| 15 | .args(args) |
| 16 | .current_dir(root) |
| 17 | .output() |
| 18 | .expect("run CLI"); |
| 19 | let text = format!( |
| 20 | "{}{}", |
| 21 | String::from_utf8_lossy(&output.stdout), |
| 22 | String::from_utf8_lossy(&output.stderr) |
| 23 | ); |
| 24 | assert_eq!(output.status.success(), succeeds, "{args:?}: {text}"); |
| 25 | text |
| 26 | } |
| 27 | |
| 28 | fn record(repo: &Repository, message: &str) -> Hash { |
| 29 | let working_copy = repo.require_working_copy_id().unwrap(); |
no test coverage detected