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
+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)
}
}