Skip to content

Commit

Permalink
test: retry for more tests (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangl-cc authored Dec 29, 2024
1 parent 78162da commit a6b432f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions crates/maa-cli/src/run/preset/copilot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ mod tests {

#[test]
#[ignore = "need downloaded from internet"]
fn try_from() {
fn try_into_maa_value() {
fn parse<I, T>(args: I) -> Result<MAAValue>
where
I: IntoIterator<Item = T>,
Expand All @@ -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)
);
}
Expand Down

0 comments on commit a6b432f

Please sign in to comment.