We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 56678c9 + 297dc93 commit 123636dCopy full SHA for 123636d
clockwork.go
@@ -97,7 +97,7 @@ func (fc *fakeClock) After(d time.Duration) <-chan time.Time {
97
defer fc.l.Unlock()
98
now := fc.time
99
done := make(chan time.Time, 1)
100
- if d.Nanoseconds() == 0 {
+ if d.Nanoseconds() <= 0 {
101
// special case - trigger immediately
102
done <- now
103
} else {
clockwork_test.go
@@ -9,6 +9,13 @@ import (
9
func TestFakeClockAfter(t *testing.T) {
10
fc := &fakeClock{}
11
12
+ neg := fc.After(-1)
13
+ select {
14
+ case <-neg:
15
+ default:
16
+ t.Errorf("negative did not return!")
17
+ }
18
+
19
zero := fc.After(0)
20
select {
21
case <-zero:
0 commit comments