Add prompt on run if --yes not specified, add tests, separate out function for filtering, bug fixes, etc

This commit is contained in:
tahahawa
2025-04-17 15:21:49 -04:00
parent ee9270d771
commit b781a7ff4a
6 changed files with 950 additions and 424 deletions

View File

@@ -16,7 +16,7 @@ async fn main() {
Box::new(ErrorScore {}),
Box::new(PanicScore {}),
]);
harmony_cli::init(maestro).await.unwrap();
harmony_cli::init(maestro, None).await.unwrap();
}
use assert_cmd::Command;
@@ -24,7 +24,7 @@ use assert_cmd::Command;
#[test]
fn test_example_success() {
let mut cmd = Command::cargo_bin("example-cli").unwrap();
let assert = cmd.args(&["--run", "--filter", "SuccessScore"]).assert();
let assert = cmd.args(&["--yes", "--filter", "SuccessScore"]).assert();
assert.success();
}
@@ -32,7 +32,7 @@ fn test_example_success() {
#[test]
fn test_example_fail() {
let mut cmd_fail = Command::cargo_bin("example-cli").unwrap();
let assert_fail = cmd_fail.args(&["--run", "--filter", "ErrorScore"]).assert();
let assert_fail = cmd_fail.args(&["--yes", "--filter", "ErrorScore"]).assert();
assert_fail.failure();
}