From 2af4b3e9212d623be5f335856b7d8600a0d1bf58 Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Thu, 10 Sep 2020 23:00:06 -0500 Subject: [PATCH] test my expectations of k-factor changes --- tests/EloTest.elm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/EloTest.elm b/tests/EloTest.elm index daa051e..d395f87 100644 --- a/tests/EloTest.elm +++ b/tests/EloTest.elm @@ -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 ]