Skip to content

Commit

Permalink
test my expectations of k-factor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Sep 11, 2020
1 parent 29612aa commit 2af4b3e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/EloTest.elm
Expand Up @@ -60,4 +60,17 @@ newRating =
Elo.newRating Elo.sensitiveKFactor player WonAgainst favorite
in
newAgainstEqual |> Expect.lessThan newAgainstFavorite
, fuzz2 ratingFuzzer (Fuzz.intRange 1 32) "a higher k-value produces a larger score difference than a lower one" <|
\player kFactorIncrease ->
let
opponent =
player + 100

( newWithLowKFactor, _ ) =
Elo.newRating Elo.sensitiveKFactor player WonAgainst opponent

( newWithHighKFactor, _ ) =
Elo.newRating (Elo.sensitiveKFactor + kFactorIncrease) player WonAgainst opponent
in
newWithLowKFactor |> Expect.lessThan newWithHighKFactor
]

0 comments on commit 2af4b3e

Please sign in to comment.