]> Cypherpunks repositories - gostls13.git/commit
time: update TestSub to avoid future regressions
authorJoe Tsai <joetsai@digital-static.net>
Fri, 16 Aug 2019 17:36:01 +0000 (10:36 -0700)
committerJoe Tsai <thebrokentoaster@gmail.com>
Fri, 16 Aug 2019 19:54:57 +0000 (19:54 +0000)
commitc485506b0aae298652448e80fca35036bfa755ac
tree17d5f7671c69ae5b5139c062dc00b883345048e4
parentbb5441de4893c0802e3445250fbcc13c7b8e105c
time: update TestSub to avoid future regressions

CL 131196 optimized Time.Sub, but was reverted because
it incorrectly computed the nanoseconds in some edge cases.
This CL adds a test case to enforce the correct behavior
so that a future optimization does not break this again.

Updates #17858
Updates #33677

Change-Id: I596d8302ca6bf721cf7ca11cc6f939639fcbdd43
Reviewed-on: https://go-review.googlesource.com/c/go/+/190524
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/time/time_test.go