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

28 lines
618 B
Go

package proto
import (
"encoding/json"
"testing"
)
func TestPingResponsesIncludeShortDramaCardID(t *testing.T) {
const productID = "6a8f066778316ccfc08c4ce7"
responses := []any{
SysInfo{ShortDramaCardID: productID},
SysInfos{ShortDramaCardID: productID},
}
for _, response := range responses {
data, err := json.Marshal(response)
if err != nil {
t.Fatal(err)
}
var decoded map[string]any
if err = json.Unmarshal(data, &decoded); err != nil {
t.Fatal(err)
}
if got := decoded["shortDramaCardId"]; got != productID {
t.Fatalf("shortDramaCardId = %v, want %s", got, productID)
}
}
}