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
+31
View File
@@ -0,0 +1,31 @@
package vidmod
import (
"reflect"
"testing"
"go.mongodb.org/mongo-driver/bson"
)
func TestLatestVIPContentFilter(t *testing.T) {
excluded := []string{"module-a", "module-b"}
got := latestVIPContentFilter(excluded)
want := bson.M{
"status": CheckPass,
"newsType": bson.M{"$in": []string{SP, SHORT}},
"coins": 0,
"freeArea": bson.M{"$ne": true},
"recoWeight": bson.M{"$ne": -1},
"mId": bson.M{"$nin": excluded},
}
if !reflect.DeepEqual(got, want) {
t.Fatalf("latestVIPContentFilter() = %#v, want %#v", got, want)
}
}
func TestLatestVIPContentFilterWithoutExcludedModules(t *testing.T) {
got := latestVIPContentFilter(nil)
if _, exists := got["mId"]; exists {
t.Fatalf("mId filter must be absent when no modules are excluded: %#v", got)
}
}