Files
rootandClaude Opus 5 8679200f41 Initial commit
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 13:57:10 +08:00

25 lines
673 B
Go

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