新增判断是否是周末的方法 (#105)

* 新增判断是否是周末的方法

* 新增判断是否是周末的方法

---------

Co-authored-by: huangxingming <huangxingming@kezaihui.com>
This commit is contained in:
hhhhhxmandhuangxingming authored and GitHub committed 2023-05-31 17:05:20 +08:00
1 parent 09ec5b97a6
commit 69b32fd043
2 files changed
+20

No files matched your search

+16
View File
@@ -286,3 +286,19 @@ func TestDayOfYear(t *testing.T) {
result3 := DayOfYear(date3)
assert.Equal(0, result3)
}
func TestIsWeekend(t *testing.T) {
assert := internal.NewAssert(t, "TestIsWeekend")
date := time.Date(2023, 06, 03, 0, 0, 0, 0, time.Local)
result := IsWeekend(date)
assert.Equal(true, result)
date1 := time.Date(2023, 06, 04, 0, 0, 0, 0, time.Local)
result1 := IsWeekend(date1)
assert.Equal(true, result1)
date2 := time.Date(2023, 06, 02, 0, 0, 0, 0, time.Local)
result2 := IsWeekend(date2)
assert.Equal(false, result2)
}