Index: src/pkg/time/time_test.go |
=================================================================== |
--- a/src/pkg/time/time_test.go |
+++ b/src/pkg/time/time_test.go |
@@ -533,6 +533,22 @@ |
} |
} |
+func TestParseInLocation(t *testing.T) { |
+ loc, err := LoadLocation("Australia/NSW") |
+ if err != nil { |
+ t.Fatal(err) |
+ } |
+ tm, err := loc.Parse(RFC1123Z, "Mon, 04 Feb 2013 08:55:00 +1100") |
+ if err != nil { |
+ t.Fatal(err) |
+ } |
+ got := fmt.Sprintf("%v in %v", tm, tm.Location()) |
+ want := "2013-02-04 08:55:00 +1100 EST in Australia/NSW" |
+ if got != want { |
+ t.Errorf("Got %v, want %v", got, want) |
+ } |
+} |
+ |
var rubyTests = []ParseTest{ |
{"RubyDate", RubyDate, "Thu Feb 04 21:00:57 -0800 2010", true, true, 1, 0}, |
// Ignore the time zone in the test. If it parses, it'll be OK. |