Skip to content

Commit

Permalink
test: add some missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wangl-cc committed Nov 27, 2023
1 parent 75142af commit 964e032
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions maa-cli/src/config/cli/maa_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ mod tests {
);
}

#[test]
fn test_time() {
assert_eq!(default_config().test_time(), 3);
assert_eq!(default_config().set_test_time(5).test_time(), 5);
}

#[test]
fn api_url() {
assert_eq!(
Expand Down
6 changes: 6 additions & 0 deletions maa-cli/src/config/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,10 @@ mod tests {
maa_cli::Config::default().with_channel(Channel::Alpha),
);
}

#[test]
fn normalize_url_test() {
assert_eq!(normalize_url("https://foo.bar"), "https://foo.bar/");
assert_eq!(normalize_url("https://foo.bar/"), "https://foo.bar/");
}
}

0 comments on commit 964e032

Please sign in to comment.