Commit 839b2824 authored by Kevin Burke's avatar Kevin Burke

time: add leap year test for Date

I'm writing a matching implementation of the time package and missed
the "add one day in a leap year" block. This test would have caught my
error.

I understand we can't add test cases for every Date but it seems like
"tripped up someone attempting to reimplement this" is a good
indicator it may trip up people in the future.

Change-Id: I4c3b51e52e269215ec0e52199afe604482326edb
Reviewed-on: https://go-review.googlesource.com/56490Reviewed-by: default avatarMatt Layher <mdlayher@gmail.com>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent e9983165
...@@ -575,6 +575,7 @@ var dateTests = []struct { ...@@ -575,6 +575,7 @@ var dateTests = []struct {
{2011, 3, 13, 1, 59, 59, 0, Local, 1300010399}, // 1:59:59 PST {2011, 3, 13, 1, 59, 59, 0, Local, 1300010399}, // 1:59:59 PST
{2011, 3, 13, 3, 0, 0, 0, Local, 1300010400}, // 3:00:00 PDT {2011, 3, 13, 3, 0, 0, 0, Local, 1300010400}, // 3:00:00 PDT
{2011, 3, 13, 2, 30, 0, 0, Local, 1300008600}, // 2:30:00 PDT ≡ 1:30 PST {2011, 3, 13, 2, 30, 0, 0, Local, 1300008600}, // 2:30:00 PDT ≡ 1:30 PST
{2012, 12, 24, 0, 0, 0, 0, Local, 1356336000}, // Leap year
// Many names for Fri Nov 18 7:56:35 PST 2011 // Many names for Fri Nov 18 7:56:35 PST 2011
{2011, 11, 18, 7, 56, 35, 0, Local, 1321631795}, // Nov 18 7:56:35 {2011, 11, 18, 7, 56, 35, 0, Local, 1321631795}, // Nov 18 7:56:35
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment