aboutsummaryrefslogtreecommitdiffstats
path: root/internal/ratelimiter/ratelimiter_test.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2018-02-11 23:01:55 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2018-02-11 23:01:55 +0100
commit8bdadaae5968d69f7db5e43981858d80ca3986d8 (patch)
treec81e7601f2fd2931e944207524616bd013bef8a5 /internal/ratelimiter/ratelimiter_test.go
parentMoved ratelimiter to internal package (diff)
downloadwireguard-go-8bdadaae5968d69f7db5e43981858d80ca3986d8.tar.xz
wireguard-go-8bdadaae5968d69f7db5e43981858d80ca3986d8.zip
Removed exported methods from ratelimiter package
Diffstat (limited to '')
-rw-r--r--internal/ratelimiter/ratelimiter_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/ratelimiter/ratelimiter_test.go b/internal/ratelimiter/ratelimiter_test.go
index a6f618b..37339ee 100644
--- a/internal/ratelimiter/ratelimiter_test.go
+++ b/internal/ratelimiter/ratelimiter_test.go
@@ -28,7 +28,7 @@ func TestRatelimiter(t *testing.T) {
)
}
- for i := 0; i < RatelimiterPacketsBurstable; i++ {
+ for i := 0; i < packetsBurstable; i++ {
Add(RatelimiterResult{
allowed: true,
text: "inital burst",
@@ -42,7 +42,7 @@ func TestRatelimiter(t *testing.T) {
Add(RatelimiterResult{
allowed: true,
- wait: Nano(time.Second.Nanoseconds() / RatelimiterPacketsPerSecond),
+ wait: Nano(time.Second.Nanoseconds() / packetsPerSecond),
text: "filling tokens for single packet",
})
@@ -53,7 +53,7 @@ func TestRatelimiter(t *testing.T) {
Add(RatelimiterResult{
allowed: true,
- wait: 2 * Nano(time.Second.Nanoseconds()/RatelimiterPacketsPerSecond),
+ wait: 2 * (Nano(time.Second.Nanoseconds() / packetsPerSecond)),
text: "filling tokens for two packet burst",
})