Skip to content

Commit

Permalink
Add test for trait
Browse files Browse the repository at this point in the history
  • Loading branch information
atomflunder committed Jun 8, 2024
1 parent 4b82398 commit dafbe58
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/trueskill/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2549,6 +2549,18 @@ mod tests {
TeamRatingSystem::expected_score(&rating_system, &[player_one], &[player_two]);

assert!((exp1 + exp2 - 1.0).abs() < f64::EPSILON);

let multi_team_rating: TrueSkill = MultiTeamRatingSystem::new(TrueSkillConfig::new());
let mtr = MultiTeamRatingSystem::rate(
&multi_team_rating,
&[
(&[player_one], MultiTeamOutcome::new(1)),
(&[player_two], MultiTeamOutcome::new(2)),
],
);

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);
}

#[test]
Expand Down

0 comments on commit dafbe58

Please sign in to comment.