FAQ
Reviewers: golang-dev_googlegroups.com,

Message:
Hello golang-dev@googlegroups.com,

I'd like you to review this change to
https://go.googlecode.com/hg/


Description:
time: add a test to verify that December exists

Now that we're at the end of November, writing a unit test for
December's existence seems prudent.

Please review this at http://codereview.appspot.com/6855103/

Affected files:
M src/pkg/time/time_test.go


Index: src/pkg/time/time_test.go
===================================================================
--- a/src/pkg/time/time_test.go
+++ b/src/pkg/time/time_test.go
@@ -1038,6 +1038,18 @@
}
}

+// TestDecemberExists tests that December exists as a month in the year.
+func TestDecemberExists(t *testing.T) {
+ nov, err := Parse(ANSIC, "Mon Nov 26 22:15:32 2012")
+ if err != nil {
+ t.Fatalf("No November? %v", err)
+ }
+ dec := nov.Add(7 * 24 * Hour)
+ if dec.Month() != December {
+ t.Errorf("the month a week after November 26th = %v; want December",
dec.Month())
+ }
+}
+
var (
t Time
u int64

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedNov 27, '12 at 6:18a
activeNov 29, '12 at 7:31p
posts9
users6
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase