From d45e1b5266db01f7de886707b281171839c6875d Mon Sep 17 00:00:00 2001 From: gouguoyin <245629560@qq.com> Date: Mon, 25 Nov 2024 01:40:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=9B=E8=A1=8C=20Unmarsha?= =?UTF-8?q?lJSON=20=E6=97=B6=E6=97=B6=E5=8C=BA=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- default_unit_test.go | 4 ++-- encoding_unit_test.go | 4 ++-- outputer_unit_test.go | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/default_unit_test.go b/default_unit_test.go index ec670e0..97b00c2 100644 --- a/default_unit_test.go +++ b/default_unit_test.go @@ -9,12 +9,12 @@ import ( func TestCarbon_SetDefault(t *testing.T) { SetDefault(Default{ Layout: DateTimeLayout, - Timezone: Local, + Timezone: PRC, Locale: "en", WeekStartsAt: Sunday, }) assert.Equal(t, DateTimeLayout, defaultLayout) - assert.Equal(t, Local, defaultTimezone) + assert.Equal(t, PRC, defaultTimezone) assert.Equal(t, "en", defaultLocale) assert.Equal(t, "Sunday", defaultWeekStartsAt) } diff --git a/encoding_unit_test.go b/encoding_unit_test.go index e65d3de..18e7588 100644 --- a/encoding_unit_test.go +++ b/encoding_unit_test.go @@ -424,6 +424,6 @@ func TestCarbon_Issue243(t *testing.T) { if err != nil { log.Fatal(err) } - assert.Equal(t, "Local", project.StartDate.Location()) - assert.Equal(t, "Local", project.EndDate.Location()) + assert.Equal(t, "PRC", project.StartDate.Location()) + assert.Equal(t, "PRC", project.EndDate.Location()) } diff --git a/outputer_unit_test.go b/outputer_unit_test.go index db967ea..2cc23c5 100644 --- a/outputer_unit_test.go +++ b/outputer_unit_test.go @@ -54,18 +54,18 @@ func TestCarbon_GoString(t *testing.T) { }, { name: "case2", - actual: Parse("0000-01-01 13:14:15").GoString(), - want: "time.Date(0, time.January, 1, 13, 14, 15, 0, time.Local)", + actual: Parse("0000-01-01 13:14:15", UTC).GoString(), + want: "time.Date(0, time.January, 1, 13, 14, 15, 0, time.UTC)", }, { name: "case3", - actual: Parse("0001-01-01 13:14:15").GoString(), - want: "time.Date(1, time.January, 1, 13, 14, 15, 0, time.Local)", + actual: Parse("0001-01-01 13:14:15", UTC).GoString(), + want: "time.Date(1, time.January, 1, 13, 14, 15, 0, time.UTC)", }, { name: "case4", - actual: Parse("2020-08-05 13:14:15").GoString(), - want: "time.Date(2020, time.August, 5, 13, 14, 15, 0, time.Local)", + actual: Parse("2020-08-05 13:14:15", UTC).GoString(), + want: "time.Date(2020, time.August, 5, 13, 14, 15, 0, time.UTC)", }, } @@ -2652,7 +2652,7 @@ func TestCarbon_ToStdTime(t *testing.T) { assert.Equal(t, expected, actual) } -// https://github.com/golang-module/carbon/issues/200 +// https://github.com/dromara/carbon/issues/200 func TestCarbon_Issue200(t *testing.T) { tests1 := []struct { name string