time: increase test coverage for Time.Sub

Existing tests don't check overflow and underflow case for subtraction
monotonic time.

Updates #17858

Change-Id: I95311440134c92eadd7d5e409a0fc7c689e9bf41
Reviewed-on: https://go-review.googlesource.com/107056
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
tengufromsky 2018-04-14 10:50:52 +03:00 committed by Brad Fitzpatrick
parent 224f807e26
commit 1670921a07
2 changed files with 7 additions and 0 deletions

View file

@ -76,3 +76,8 @@ func CheckRuntimeTimerOverflow() {
// So we fall back to hope: We hope we don't hang here.
<-t.C
}
var (
MinMonoTime = Time{wall: 1 << 63, ext: -1 << 63, loc: UTC}
MaxMonoTime = Time{wall: 1 << 63, ext: 1<<63 - 1, loc: UTC}
)