1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
12 func TestVersion3(t
*testing
.T
) {
13 t
.Skip("gccgo does not use the zip file")
14 time
.ForceZipFileForTesting(true)
15 defer time
.ForceZipFileForTesting(false)
16 _
, err
:= time
.LoadLocation("Asia/Jerusalem")
22 // Test that we get the correct results for times before the first
23 // transition time. To do this we explicitly check early dates in a
24 // couple of specific timezones.
25 func TestFirstZone(t
*testing
.T
) {
26 t
.Skip("gccgo does not use the zip file")
28 time
.ForceZipFileForTesting(true)
29 defer time
.ForceZipFileForTesting(false)
31 const format
= "Mon, 02 Jan 2006 15:04:05 -0700 (MST)"
32 var tests
= []struct {
41 "Sun, 31 Mar 1918 01:59:59 -0800 (PST)",
42 "Sun, 31 Mar 1918 03:00:00 -0700 (PDT)",
47 "Thu, 29 Dec 2011 23:59:59 -1100 (TKT)",
48 "Sat, 31 Dec 2011 00:00:00 +1300 (TKT)",
52 for _
, test
:= range tests
{
53 z
, err
:= time
.LoadLocation(test
.zone
)
57 s
:= time
.Unix(test
.unix
, 0).In(z
).Format(format
)
59 t
.Errorf("for %s %d got %q want %q", test
.zone
, test
.unix
, s
, test
.want1
)
61 s
= time
.Unix(test
.unix
+1, 0).In(z
).Format(format
)
63 t
.Errorf("for %s %d got %q want %q", test
.zone
, test
.unix
, s
, test
.want2
)