@@ -56,7 +56,7 @@ func TestAllow(t *testing.T) {
5656 assert .InDelta (t , res .ResetAfter , 999 * time .Millisecond , float64 (10 * time .Millisecond ))
5757}
5858
59- func TestAllowAtMostN (t * testing.T ) {
59+ func TestAllowAtMost (t * testing.T ) {
6060 ctx := context .Background ()
6161
6262 l := rateLimiter ()
@@ -69,7 +69,7 @@ func TestAllowAtMostN(t *testing.T) {
6969 assert .Equal (t , res .RetryAfter , time .Duration (- 1 ))
7070 assert .InDelta (t , res .ResetAfter , 100 * time .Millisecond , float64 (10 * time .Millisecond ))
7171
72- res , err = l .AllowAtMostN (ctx , "test_id" , limit , 2 )
72+ res , err = l .AllowAtMost (ctx , "test_id" , limit , 2 )
7373 assert .Nil (t , err )
7474 assert .Equal (t , res .Allowed , 2 )
7575 assert .Equal (t , res .Remaining , 7 )
@@ -83,7 +83,7 @@ func TestAllowAtMostN(t *testing.T) {
8383 assert .Equal (t , res .RetryAfter , time .Duration (- 1 ))
8484 assert .InDelta (t , res .ResetAfter , 300 * time .Millisecond , float64 (10 * time .Millisecond ))
8585
86- res , err = l .AllowAtMostN (ctx , "test_id" , limit , 10 )
86+ res , err = l .AllowAtMost (ctx , "test_id" , limit , 10 )
8787 assert .Nil (t , err )
8888 assert .Equal (t , res .Allowed , 7 )
8989 assert .Equal (t , res .Remaining , 0 )
@@ -97,7 +97,7 @@ func TestAllowAtMostN(t *testing.T) {
9797 assert .Equal (t , res .RetryAfter , time .Duration (- 1 ))
9898 assert .InDelta (t , res .ResetAfter , 999 * time .Millisecond , float64 (10 * time .Millisecond ))
9999
100- res , err = l .AllowAtMostN (ctx , "test_id" , limit , 1000 )
100+ res , err = l .AllowAtMost (ctx , "test_id" , limit , 1000 )
101101 assert .Nil (t , err )
102102 assert .Equal (t , res .Allowed , 0 )
103103 assert .Equal (t , res .Remaining , 0 )
@@ -132,7 +132,7 @@ func BenchmarkAllow(b *testing.B) {
132132 })
133133}
134134
135- func BenchmarkAllowAtMostN (b * testing.B ) {
135+ func BenchmarkAllowAtMost (b * testing.B ) {
136136 ctx := context .Background ()
137137 l := rateLimiter ()
138138 limit := redis_rate .PerSecond (1e6 )
@@ -141,7 +141,7 @@ func BenchmarkAllowAtMostN(b *testing.B) {
141141
142142 b .RunParallel (func (pb * testing.PB ) {
143143 for pb .Next () {
144- res , err := l .AllowAtMostN (ctx , "foo" , limit , 1 )
144+ res , err := l .AllowAtMost (ctx , "foo" , limit , 1 )
145145 if err != nil {
146146 b .Fatal (err )
147147 }
0 commit comments