(args: &[&str])
| 59 | } |
| 60 | |
| 61 | async fn run_cli(args: &[&str]) -> CliResult { |
| 62 | let mut cmd = openshell_cmd(); |
| 63 | cmd.args(args).stdout(Stdio::piped()).stderr(Stdio::piped()); |
| 64 | |
| 65 | let output = cmd.output().await.expect("spawn openshell command"); |
| 66 | let stdout = String::from_utf8_lossy(&output.stdout).to_string(); |
| 67 | let stderr = String::from_utf8_lossy(&output.stderr).to_string(); |
| 68 | let combined = format!("{stdout}{stderr}"); |
| 69 | |
| 70 | CliResult { |
| 71 | clean_output: strip_ansi(&combined), |
| 72 | success: output.status.success(), |
| 73 | exit_code: output.status.code(), |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | fn assert_setting_line(output: &str, key: &str, expected: &str) { |
| 78 | let needle = format!("{key} = {expected}"); |
no test coverage detected