* refactor: rename package

* fix: fix govet issues

* fix: misspellings
This commit is contained in:
Hexxa 2018-05-30 08:09:13 -05:00 committed by GitHub
parent 2cbe4209a9
commit ac05637658
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 41 additions and 42 deletions

View file

@ -269,7 +269,7 @@ func TestCopyRange(t *testing.T) {
}
}
if res.StatusCode != tCase.Output.StatusCode {
t.Fatalf("copyRange: statusCodes are not match %v", res.StatusCode, tCase.Output.StatusCode)
t.Fatalf("copyRange: statusCodes are not match got: %v want: %v", res.StatusCode, tCase.Output.StatusCode)
}
}
}
@ -348,7 +348,7 @@ func TestServeAll(t *testing.T) {
}
}
if res.StatusCode != tCase.Output.StatusCode {
t.Fatalf("serveAll: statusCodes are not match %v", res.StatusCode, tCase.Output.StatusCode)
t.Fatalf("serveAll: statusCodes are not match got: %v want: %v", res.StatusCode, tCase.Output.StatusCode)
}
}
}

View file

@ -33,7 +33,7 @@ func TestIpLimit(t *testing.T) {
walls := newAccessWalls(1000, ttl, cyc, limit)
testIpLimit(t, walls, ip, limit)
// wait for tokens are re-fullfilled
// wait for tokens are re-fulfilled
time.Sleep(time.Duration(cyc) * time.Second)
testIpLimit(t, walls, ip, limit)
@ -43,12 +43,12 @@ func TestIpLimit(t *testing.T) {
func testIpLimit(t *testing.T, walls Walls, ip string, limit int16) {
for i := int16(0); i < limit; i++ {
if !walls.PassIpLimit(ip) {
t.Fatalf("ipLimiter: should be passed", time.Now().Unix())
t.Fatalf("ipLimiter: should be passed %d", time.Now().Unix())
}
}
if walls.PassIpLimit(ip) {
t.Fatalf("ipLimiter: should not be passed", time.Now().Unix())
t.Fatalf("ipLimiter: should not be passed %d", time.Now().Unix())
}
}
@ -62,7 +62,7 @@ func TestOpLimit(t *testing.T) {
testOpLimit(t, walls, resourceId, op1, limit)
testOpLimit(t, walls, resourceId, op2, limit)
// wait for tokens are re-fullfilled
// wait for tokens are re-fulfilled
time.Sleep(time.Duration(ttl) * time.Second)
testOpLimit(t, walls, resourceId, op1, limit)
testOpLimit(t, walls, resourceId, op2, limit)