Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for ResetLocalOnceForTest (0.49 sec)

  1. src/time/zoneinfo_unix_test.go

    	}
    
    	for _, c := range cases {
    		time.ResetLocalOnceForTest()
    		if c.nilFlag {
    			os.Unsetenv(env)
    		} else {
    			os.Setenv(env, c.tz)
    		}
    		if time.Local.String() != c.local {
    			t.Errorf("invalid Local location name for %q: got %q want %q", c.tz, time.Local, c.local)
    		}
    	}
    
    	time.ResetLocalOnceForTest()
    	// The file may not exist on Solaris 2 and IRIX 6.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 29 16:24:51 UTC 2022
    - 2.3K bytes
    - Viewed (0)
  2. src/time/export_windows_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 ForceAusFromTZIForTesting() {
    	ResetLocalOnceForTest()
    	localOnce.Do(func() { initLocalFromTZI(&aus) })
    }
    
    func ForceUSPacificFromTZIForTesting() {
    	ResetLocalOnceForTest()
    	localOnce.Do(func() { initLocalFromTZI(&usPacific) })
    }
    
    func ToEnglishName(stdname, dstname string) (string, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 27 14:14:45 UTC 2017
    - 514 bytes
    - Viewed (0)
  3. src/time/export_test.go

    // Use of this source code is governed by a BSD-style
    // 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() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 24 19:23:32 UTC 2022
    - 4K bytes
    - Viewed (0)
  4. src/time/time_test.go

    		if err != nil || d0 != d1 {
    			t.Errorf("round-trip failed: %d => %q => %d, %v", d0, s, d1, err)
    		}
    	}
    }
    
    // golang.org/issue/4622
    func TestLocationRace(t *testing.T) {
    	ResetLocalOnceForTest() // reset the Once to trigger the race
    
    	c := make(chan string, 1)
    	go func() {
    		c <- Now().String()
    	}()
    	_ = Now().String()
    	<-c
    	Sleep(100 * Millisecond)
    
    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