Skip to content

Commit

Permalink
✅ test: update test case
Browse files Browse the repository at this point in the history
  • Loading branch information
jingyuexing committed Jan 31, 2024
1 parent e80f4b9 commit 77cbcce
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}

Expand Down

0 comments on commit 77cbcce

Please sign in to comment.