Skip to content

Commit

Permalink
Add test for expected score trait
Browse files Browse the repository at this point in the history
  • Loading branch information
atomflunder committed Jun 8, 2024
1 parent dafbe58 commit 0f58d05
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/trueskill/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2561,6 +2561,13 @@ mod tests {

assert!((mtr[0][0].rating - 24.534_091_256_161_39).abs() < f64::EPSILON);
assert!((mtr[1][0].rating - 23.465_908_743_838_607).abs() < f64::EPSILON);

let exp = MultiTeamRatingSystem::expected_score(
&multi_team_rating,
&[&[player_one], &[player_two]],
);

assert!(((exp.iter().sum::<f64>()) - 1.0).abs() < f64::EPSILON);
}

#[test]
Expand Down

0 comments on commit 0f58d05

Please sign in to comment.