Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for ForceUSPacificForTesting (0.26 sec)

  1. src/time/zoneinfo_windows_test.go

    	}
    }
    
    func TestUSPacificZoneAbbr(t *testing.T) {
    	ForceUSPacificFromTZIForTesting() // reset the Once to trigger the race
    	defer ForceUSPacificForTesting()
    	testZoneAbbr(t)
    }
    
    func TestAusZoneAbbr(t *testing.T) {
    	ForceAusFromTZIForTesting()
    	defer ForceUSPacificForTesting()
    	testZoneAbbr(t)
    }
    
    func TestToEnglishName(t *testing.T) {
    	const want = "Central Europe Standard Time"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 14 07:20:34 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  2. src/time/internal_test.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package time
    
    func init() {
    	// Force US/Pacific for time zone tests.
    	ForceUSPacificForTesting()
    }
    
    func initTestingZone() {
    	// For hermeticity, use only tzinfo source from the test's GOROOT,
    	// not the system sources and not whatever GOROOT may happen to be
    	// set in the process's environment (if any).
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 03 14:56:37 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  3. src/time/zoneinfo_unix_test.go

    	"time"
    )
    
    func TestEnvTZUsage(t *testing.T) {
    	const env = "TZ"
    	tz, ok := os.LookupEnv(env)
    	if !ok {
    		defer os.Unsetenv(env)
    	} else {
    		defer os.Setenv(env, tz)
    	}
    	defer time.ForceUSPacificForTesting()
    
    	localZoneName := "Local"
    	// The file may not exist.
    	if _, err := os.Stat("/etc/localtime"); os.IsNotExist(err) {
    		localZoneName = "UTC"
    	}
    
    	cases := []struct {
    		nilFlag bool
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 29 16:24:51 UTC 2022
    - 2.3K bytes
    - Viewed (0)
  4. src/time/export_test.go

    // license that can be found in the LICENSE file.
    
    package time
    
    import (
    	"sync"
    )
    
    func ResetLocalOnceForTest() {
    	localOnce = sync.Once{}
    	localLoc = Location{}
    }
    
    func ForceUSPacificForTesting() {
    	ResetLocalOnceForTest()
    	localOnce.Do(initTestingZone)
    }
    
    func ZoneinfoForTesting() *string {
    	return zoneinfo
    }
    
    func ResetZoneinfoForTesting() {
    	zoneinfo = nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 24 19:23:32 UTC 2022
    - 4K bytes
    - Viewed (0)
  5. src/time/time_test.go

    	c := make(chan string, 1)
    	go func() {
    		c <- Now().String()
    	}()
    	_ = Now().String()
    	<-c
    	Sleep(100 * Millisecond)
    
    	// Back to Los Angeles for subsequent tests:
    	ForceUSPacificForTesting()
    }
    
    var (
    	t Time
    	u int64
    )
    
    var mallocTest = []struct {
    	count int
    	desc  string
    	fn    func()
    }{
    	{0, `time.Now()`, func() { t = Now() }},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:13:47 UTC 2024
    - 56.5K bytes
    - Viewed (0)
Back to top