Skip to content

Commit

Permalink
Nicer threshold check in test.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisberkhout committed Dec 11, 2024
1 parent 996fc71 commit 18c8e96
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func TestRateLimiter(t *testing.T) {
target := 30.0
buffer := 0.01

if tokens < target-buffer || tokens > target+buffer {
if tokens < target-buffer || target+buffer < tokens {
t.Errorf("tokens don't accumulate at the expected rate over 30s: %f", tokens)
}
})
Expand Down

0 comments on commit 18c8e96

Please sign in to comment.