cleanup/small refactor + first tests

This commit is contained in:
2025-07-17 19:28:21 +02:00
parent 6688128d30
commit 68000a0f0a
6 changed files with 99 additions and 61 deletions

View File

@@ -0,0 +1,17 @@
package helper
import (
"testing"
"time"
)
func TestGetMonday(t *testing.T) {
isMonday, err := time.Parse("2006-01-02", "2025-07-14")
notMonday, err := time.Parse("2006-01-02", "2025-07-16")
if err != nil || isMonday == notMonday {
t.Errorf("U stupid? %e", err)
}
if GetMonday(isMonday) != isMonday || GetMonday(notMonday) != isMonday {
t.Error("Wrong date conversion!")
}
}