~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/time/time_test.go

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
}
143
143
 
144
144
var formatTests = []FormatTest{
145
 
        {"ANSIC", ANSIC, "Thu Feb  4 21:00:57 2010"},
146
 
        {"UnixDate", UnixDate, "Thu Feb  4 21:00:57 PST 2010"},
147
 
        {"RubyDate", RubyDate, "Thu Feb 04 21:00:57 -0800 2010"},
148
 
        {"RFC822", RFC822, "04 Feb 10 2100 PST"},
149
 
        {"RFC850", RFC850, "Thursday, 04-Feb-10 21:00:57 PST"},
150
 
        {"RFC1123", RFC1123, "Thu, 04 Feb 2010 21:00:57 PST"},
151
 
        {"RFC3339", RFC3339, "2010-02-04T21:00:57-08:00"},
 
145
        {"ANSIC", ANSIC, "Wed Feb  4 21:00:57 2009"},
 
146
        {"UnixDate", UnixDate, "Wed Feb  4 21:00:57 PST 2009"},
 
147
        {"RubyDate", RubyDate, "Wed Feb 04 21:00:57 -0800 2009"},
 
148
        {"RFC822", RFC822, "04 Feb 09 2100 PST"},
 
149
        {"RFC850", RFC850, "Wednesday, 04-Feb-09 21:00:57 PST"},
 
150
        {"RFC1123", RFC1123, "Wed, 04 Feb 2009 21:00:57 PST"},
 
151
        {"RFC3339", RFC3339, "2009-02-04T21:00:57-08:00"},
152
152
        {"Kitchen", Kitchen, "9:00PM"},
153
153
        {"am/pm", "3pm", "9pm"},
154
154
        {"AM/PM", "3PM", "9PM"},
 
155
        {"two-digit year", "06 01 02", "09 02 04"},
155
156
}
156
157
 
157
158
func TestFormat(t *testing.T) {
158
159
        // The numeric time represents Thu Feb  4 21:00:57 PST 2010
159
 
        time := SecondsToLocalTime(1265346057)
 
160
        time := SecondsToLocalTime(1233810057)
160
161
        for _, test := range formatTests {
161
162
                result := time.Format(test.format)
162
163
                if result != test.result {