feat: updated docs and added description to files
This commit is contained in:
@@ -132,41 +132,3 @@ func TestFormatGermanDayOfWeek(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetKW(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
date time.Time
|
||||
want int
|
||||
}{
|
||||
{
|
||||
name: "First week of year",
|
||||
date: time.Date(2023, 1, 2, 0, 0, 0, 0, time.UTC), // Monday
|
||||
want: 1,
|
||||
},
|
||||
{
|
||||
name: "Middle of year",
|
||||
date: time.Date(2023, 6, 15, 0, 0, 0, 0, time.UTC),
|
||||
want: 24,
|
||||
},
|
||||
{
|
||||
name: "Last week of year",
|
||||
date: time.Date(2023, 12, 31, 0, 0, 0, 0, time.UTC),
|
||||
want: 52,
|
||||
},
|
||||
{
|
||||
name: "ISO week crossing into next year",
|
||||
date: time.Date(2020, 12, 31, 0, 0, 0, 0, time.UTC),
|
||||
want: 53,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got := GetKW(tt.date)
|
||||
if got != tt.want {
|
||||
t.Errorf("GetKW(%v) = %d, want %d", tt.date, got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user