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 a7c46a9 commit e80f4b9
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,20 +309,11 @@ func TestDateTime(t *testing.T) {
t.Error("the add 2 year has wrong")
}

if datetime.Add(1,"week").Day != 6 {
t.Error("the add 1 week has wrong")
if datetime.Add(1,"week").Month != 2 {
t.Error(fmt.Sprintf("Expect: Month is %d, but got Month %d",2 ,datetime.Add(1,"week").Month))
}
fmt.Println(datetime.String())


if datetime.String() != "2024-01-30T07:51:32.5132Z" {
t.Error(fmt.Sprintf("Expect: %s, but got %s","2024-01-30T07:51:32.5132Z",datetime.String()))
}

if datetime.Add(100,"D").String() != "2024-05-09T07:51:32.5132Z" {
t.Error(fmt.Sprintf("Expect: %s, but got %s","2024-01-30T07:51:32.5132Z",datetime.Add(100,"D").String()))
}

if datetime.CurrentYearDays() != 366 {
t.Error("caculate has wrong")
}
Expand Down

0 comments on commit e80f4b9

Please sign in to comment.