summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/timer_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/tcpip/timer_test.go')
-rw-r--r--pkg/tcpip/timer_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/pkg/tcpip/timer_test.go b/pkg/tcpip/timer_test.go
index e6783b126..8c43dd627 100644
--- a/pkg/tcpip/timer_test.go
+++ b/pkg/tcpip/timer_test.go
@@ -38,6 +38,21 @@ func TestMonotonicTimeBefore(t *testing.T) {
}
}
+func TestMonotonicTimeAfter(t *testing.T) {
+ var mt tcpip.MonotonicTime
+ if mt.After(mt) {
+ t.Errorf("%#v.After(%#v)", mt, mt)
+ }
+
+ one := mt.Add(1)
+ if mt.After(one) {
+ t.Errorf("%#v.After(%#v)", mt, one)
+ }
+ if !one.After(mt) {
+ t.Errorf("!%#v.After(%#v)", one, mt)
+ }
+}
+
func TestMonotonicTimeAddSub(t *testing.T) {
var mt tcpip.MonotonicTime
if one, two := mt.Add(2), mt.Add(1).Add(1); one != two {