mirror of
https://gitee.com/johng/gf
synced 2026-06-27 17:57:21 +08:00
fix issue of data race in unit testing case for package gtime
This commit is contained in:
@ -15,17 +15,14 @@ import (
|
||||
"github.com/gogf/gf/test/gtest"
|
||||
)
|
||||
|
||||
// DATA RACE!
|
||||
//time.Now()
|
||||
// /home/travis/.gimme/versions/go1.11.13.linux.amd64/src/time/time.go:1060 +0xcf
|
||||
//time.sendTime()
|
||||
// /home/travis/.gimme/versions/go1.11.13.linux.amd64/src/time/sleep.go:141 +0x44
|
||||
//func Test_SetTimeZone(t *testing.T) {
|
||||
// gtest.C(t, func(t *gtest.T) {
|
||||
// gtime.SetTimeZone("Asia/Shanghai")
|
||||
// t.Assert(time.Local.String(), "Asia/Shanghai")
|
||||
// })
|
||||
//}
|
||||
func init() {
|
||||
gtime.SetTimeZone("Asia/Shanghai")
|
||||
}
|
||||
func Test_SetTimeZone(t *testing.T) {
|
||||
gtest.C(t, func(t *gtest.T) {
|
||||
t.Assert(time.Local.String(), "Asia/Shanghai")
|
||||
})
|
||||
}
|
||||
|
||||
func Test_Nanosecond(t *testing.T) {
|
||||
gtest.C(t, func(t *gtest.T) {
|
||||
|
||||
Reference in New Issue
Block a user