Add failure test

This commit is contained in:
tahahawa 2025-04-14 17:13:57 -04:00 committed by taha
parent e845544035
commit ee9270d771

View File

@ -22,9 +22,17 @@ async fn main() {
use assert_cmd::Command;
#[test]
fn test_example() {
fn test_example_success() {
let mut cmd = Command::cargo_bin("example-cli").unwrap();
let assert = cmd.arg("--run").arg("SuccessScore").assert();
let assert = cmd.args(&["--run", "--filter", "SuccessScore"]).assert();
assert.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();
assert_fail.failure();
}