mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
224f807e26
commit
1670921a07
2 changed files with 7 additions and 0 deletions
|
|
@ -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}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue