init: hgmj server initial commit

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 16:50:13 +08:00
co-authored by Claude Opus 4.7
commit 625e89c15d
1870 changed files with 254090 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
package vidmod
import "testing"
func TestCalculateRecommendScore(t *testing.T) {
if got, want := CalculateRecommendScore(1, 2, 3, 4), int64(34); got != want {
t.Fatalf("score=%d want=%d", got, want)
}
if got := CalculateRecommendScore(0, 0, 0, 0); got != 0 {
t.Fatalf("zero score=%d", got)
}
}
func TestNonNegativeHistoryValue(t *testing.T) {
if got := nonNegativeInt(-1); got != 0 {
t.Fatalf("negative history=%d want=0", got)
}
if got := maxInt64(8, nonNegativeInt(3)); got != 8 {
t.Fatalf("existing monotonic count overwritten: %d", got)
}
if got := maxInt64(2, nonNegativeInt(3)); got != 3 {
t.Fatalf("history initialization=%d want=3", got)
}
}