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
+33
View File
@@ -0,0 +1,33 @@
package mediaService
import (
"testing"
"91porn-server/models/v/mediamod"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func TestNormalizeImportedTagClassification(t *testing.T) {
dimension, dimensionType, kind := normalizeImportedTagClassification(5, "画面风格", 1, mediamod.RiFan)
if dimension != "剧场" || dimensionType != 5 || kind != mediamod.Theater {
t.Fatalf("drama classification = (%q, %d, %d), want (%q, %d, %d)", dimension, dimensionType, kind, "剧场", 5, mediamod.Theater)
}
dimension, dimensionType, kind = normalizeImportedTagClassification(1, "画面风格", 1, mediamod.RiFan)
if dimension != "画面风格" || dimensionType != 1 || kind != mediamod.RiFan {
t.Fatalf("animation classification changed to (%q, %d, %d)", dimension, dimensionType, kind)
}
}
func TestPrepareImportedTagIDs(t *testing.T) {
current := []primitive.ObjectID{primitive.NewObjectID()}
if got := prepareImportedTagIDs(5, current); len(got) != 0 {
t.Fatalf("drama retained %d existing tags, want 0", len(got))
}
got := prepareImportedTagIDs(1, current)
if len(got) != 1 || got[0] != current[0] {
t.Fatalf("animation tags = %v, want %v", got, current)
}
}