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 sysconfdata
import (
"testing"
"91porn-server/models/v/sysconfmod"
)
func TestTotalWatchCount(t *testing.T) {
tests := []struct {
name string
config sysconfmod.ConfMap
want uint64
}{
{name: "configured", config: sysconfmod.ConfMap{string(sysconfmod.VCodeTotalWatchCount): "5"}, want: 5},
{name: "zero is allowed", config: sysconfmod.ConfMap{string(sysconfmod.VCodeTotalWatchCount): "0"}, want: 0},
{name: "missing", config: sysconfmod.ConfMap{}, want: DefaultTotalWatchCount},
{name: "invalid", config: sysconfmod.ConfMap{string(sysconfmod.VCodeTotalWatchCount): "invalid"}, want: DefaultTotalWatchCount},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := totalWatchCount(tt.config); got != tt.want {
t.Fatalf("totalWatchCount() = %d, want %d", got, tt.want)
}
})
}
}