From a6b432f59c061548308e2e8ee7e26541baed4e5e Mon Sep 17 00:00:00 2001 From: Loong <40141251+wangl-cc@users.noreply.github.com> Date: Sun, 29 Dec 2024 15:45:49 +0000 Subject: [PATCH] test: retry for more tests (#360) --- crates/maa-cli/src/run/preset/copilot.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/maa-cli/src/run/preset/copilot.rs b/crates/maa-cli/src/run/preset/copilot.rs index 9d1ddc23..80c4c1f2 100644 --- a/crates/maa-cli/src/run/preset/copilot.rs +++ b/crates/maa-cli/src/run/preset/copilot.rs @@ -711,7 +711,7 @@ mod tests { #[test] #[ignore = "need downloaded from internet"] - fn try_from() { + fn try_into_maa_value() { fn parse(args: I) -> Result where I: IntoIterator, @@ -726,11 +726,17 @@ mod tests { assert!(parse(["maa", "ssscopilot", "maa://40051"]).is_err()); assert_params!( - parse(["maa", "ssscopilot", "maa://40451"]).unwrap(), + retry(3, || parse(["maa", "ssscopilot", "maa://40451"])), object!("filename" => "40451.json", "loop_times" => 1) ); assert_params!( - parse(["maa", "ssscopilot", "maa://40451", "--loop-times", "2"]).unwrap(), + retry(3, || parse([ + "maa", + "ssscopilot", + "maa://40451", + "--loop-times", + "2" + ])), object!("filename" => "40451.json", "loop_times" => 2) ); }