Initial commit

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 13:57:10 +08:00
co-authored by Claude Opus 5
commit 8679200f41
1897 changed files with 257900 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
package usermod
import (
"testing"
"time"
)
func TestRenewDramaExpire(t *testing.T) {
now := time.Date(2026, 8, 26, 12, 0, 0, 0, time.UTC)
tests := []struct {
name string
current time.Time
days int
want time.Time
}{
{name: "starts from now", days: 30, want: now.AddDate(0, 0, 30)},
{name: "extends active entitlement", current: now.AddDate(0, 0, 10), days: 30, want: now.AddDate(0, 0, 40)},
{name: "refunds active entitlement", current: now.AddDate(0, 0, 30), days: -7, want: now.AddDate(0, 0, 23)},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := RenewDramaExpire(tt.current, now, tt.days); !got.Equal(tt.want) {
t.Fatalf("RenewDramaExpire() = %s, want %s", got, tt.want)
}
})
}
}