mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2025-01-24 09:47:26 -08:00
update tests for val-content
This commit is contained in:
parent
3c90e0ef3a
commit
979c1bc10d
1 changed files with 12 additions and 2 deletions
|
@ -53,7 +53,13 @@ macro_rules! rassert {
|
|||
|
||||
#[macro_export]
|
||||
macro_rules! rassert_eq {
|
||||
( $a:expr, $b:expr ) => { rassert!($a == $b) };
|
||||
( $a:expr, $b:expr ) => {
|
||||
{
|
||||
let a = &$a;
|
||||
let b = &$b;
|
||||
rassert!(a == b, "should be equal: {:?}, {:?}", a, b)
|
||||
}
|
||||
};
|
||||
( $a:expr, $b:expr, $format:expr $(, $arg:expr)* ) => {
|
||||
rassert!($a == $b, $format $(, $arg )* )
|
||||
};
|
||||
|
@ -413,7 +419,11 @@ pub async fn val_content_ranked(route: ValPlatformRoute) -> Result<(), String> {
|
|||
act.id, act.name
|
||||
))?;
|
||||
|
||||
rassert_eq!(act.id, leaderboard.act_id);
|
||||
if leaderboard.act_id.is_empty() {
|
||||
eprintln!("Leaderboard has empty `act_id`, continuing anyway.");
|
||||
} else {
|
||||
rassert_eq!(act.id, leaderboard.act_id);
|
||||
}
|
||||
|
||||
for (i, p) in leaderboard.players.iter().take(10).enumerate() {
|
||||
rassert_eq!(i + 1, p.leaderboard_rank as usize);
|
||||
|
|
Loading…
Reference in a new issue