1
0
mirror of https://github.com/golang/go synced 2024-10-01 11:28:34 -06:00
go/src/time
Joe Tsai c485506b0a 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>
2019-08-16 19:54:57 +00:00
..
example_test.go time: move the explanation of u/micro to the ParseDuration example 2019-02-28 00:24:56 +00:00
export_android_test.go
export_test.go time: add support for day-of-year in Format and Parse 2019-03-08 01:21:33 +00:00
export_windows_test.go
format_test.go time: fix misleading error with the leading zero format 2019-04-26 14:01:55 +00:00
format.go time: fix misleading error with the leading zero format 2019-04-26 14:01:55 +00:00
genzabbrs.go
internal_test.go
mono_test.go
sleep_test.go all: update stale test skips 2018-08-20 13:10:24 +00:00
sleep.go time: clarify when draining a Timer's channel is needed 2019-07-18 20:43:28 +00:00
sys_plan9.go
sys_unix.go time: add AIX operating system 2018-10-10 14:15:57 +00:00
sys_windows.go
tick_test.go
tick.go time: add clarification to Timer.Stop documentation 2018-07-11 22:06:22 +00:00
time_test.go time: update TestSub to avoid future regressions 2019-08-16 19:54:57 +00:00
time.go Revert "time: optimize Sub" 2019-08-16 17:01:35 +00:00
zoneinfo_abbrs_windows.go
zoneinfo_android_test.go
zoneinfo_android.go time: return ENOENT from androidLoadTzinfoFromTzdata if zone not found 2018-09-15 14:58:35 +00:00
zoneinfo_ios.go os,time: fix tests on iOS 2019-05-01 13:53:44 +00:00
zoneinfo_js.go time: handle negative offsets on js/wasm 2018-11-08 17:33:49 +00:00
zoneinfo_plan9.go
zoneinfo_read.go time: reject tzdata with no zones 2019-02-27 18:08:03 +00:00
zoneinfo_test.go time: reject tzdata with no zones 2019-02-27 18:08:03 +00:00
zoneinfo_unix.go time: return correct zone info on js/wasm 2018-10-24 15:42:36 +00:00
zoneinfo_windows_test.go time: always run ZoneAbbr test 2018-08-20 14:39:59 +00:00
zoneinfo_windows.go
zoneinfo.go all: use "reports whether" consistently instead of "returns whether" 2018-12-02 15:12:26 +00:00