diff options
author | tengufromsky <nick27surgut@gmail.com> | 2018-04-14 10:50:52 +0300 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2018-04-16 21:14:40 +0000 |
commit | 1670921a07bc25116d6fdcafb849e1ff8bd6e9bc (patch) | |
tree | 9ed930847e5ab0d4ff6cc7cf2150afa0e17ffbd7 /src/time/time_test.go | |
parent | 224f807e268e97aa7ddd17bb1f91705a00041511 (diff) | |
download | go-1670921a07bc25116d6fdcafb849e1ff8bd6e9bc.tar.gz go-1670921a07bc25116d6fdcafb849e1ff8bd6e9bc.zip |
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>
Diffstat (limited to 'src/time/time_test.go')
-rw-r--r-- | src/time/time_test.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/time/time_test.go b/src/time/time_test.go index cde99e2622..7778bf1f83 100644 --- a/src/time/time_test.go +++ b/src/time/time_test.go @@ -978,6 +978,8 @@ var subTests = []struct { {Date(2300, 1, 1, 0, 0, 0, 0, UTC), Date(2000, 1, 1, 0, 0, 0, 0, UTC), Duration(maxDuration)}, {Date(2000, 1, 1, 0, 0, 0, 0, UTC), Date(2290, 1, 1, 0, 0, 0, 0, UTC), -290*365*24*Hour - 71*24*Hour}, {Date(2000, 1, 1, 0, 0, 0, 0, UTC), Date(2300, 1, 1, 0, 0, 0, 0, UTC), Duration(minDuration)}, + {MinMonoTime, MaxMonoTime, minDuration}, + {MaxMonoTime, MinMonoTime, maxDuration}, } func TestSub(t *testing.T) { |