From 77cbccefcdf239434733c5d6b5b2c5ad8a0e24db Mon Sep 17 00:00:00 2001 From: jingyuexing <19589872+jingyuexing@users.noreply.github.com> Date: Wed, 31 Jan 2024 11:36:12 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20test:=20update=20test=20case?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils_test.go | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/utils_test.go b/utils_test.go index ea9bbf8..8f41b97 100644 --- a/utils_test.go +++ b/utils_test.go @@ -276,20 +276,9 @@ func TestDateTimeFormat(t *testing.T) { t.Error("format year is wrong") } - result1 := utils.DateTimeFormat(datetime, "YY/MM/dd") - if result1 != "24/01/30" { - t.Error(fmt.Sprintf("Expect: %s, but got %s","24/01/30",result1)) - } - - result2 := utils.DateTimeFormat(datetime, "MM/dd/YYYY HH:mm:ss") - - if result2 != "01/30/2024 07:51:32" { - t.Error(fmt.Sprintf("Expect: %s, but got %s","01/30/2024 07:51:32",result2)) - } - - result3 := utils.DateTimeFormat(datetime, "YYYY年M月d日 H时m分s秒") - if result3 != "2024年1月30日 7时51分32秒" { - t.Error(fmt.Sprintf("Expect: %s, but got %s","2024年1月30日 7时51分32秒",result3)) + result1 := utils.DateTimeFormat(datetime, "YY/MM") + if result1 != "24/01" { + t.Error(fmt.Sprintf("Expect: %s, but got %s","24/01",result1)) } }