Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1320)

Unified Diff: src/pkg/time/time_test.go

Issue 7278049: code review 7278049: time: add Location.Parse (Closed)
Patch Set: diff -r ada7873ff329 https://go.googlecode.com/hg/ Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/time/format.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « src/pkg/time/format.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b