16 lines
352 B
Go
16 lines
352 B
Go
package store
|
|
|
|
import "testing"
|
|
|
|
func TestRandomDelaySeconds(t *testing.T) {
|
|
for index := 0; index < 100; index++ {
|
|
value := randomDelaySeconds(900, 1200)
|
|
if value < 900 || value > 1200 {
|
|
t.Fatalf("delay out of range: %d", value)
|
|
}
|
|
}
|
|
if value := randomDelaySeconds(30, 30); value != 30 {
|
|
t.Fatalf("fixed delay = %d, want 30", value)
|
|
}
|
|
}
|