wechat_test.go 556 B

123456789101112131415161718192021222324
  1. package wechat_test
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/v2fly/v2ray-core/v5/common"
  6. "github.com/v2fly/v2ray-core/v5/common/buf"
  7. . "github.com/v2fly/v2ray-core/v5/transport/internet/headers/wechat"
  8. )
  9. func TestUTPWrite(t *testing.T) {
  10. videoRaw, err := NewVideoChat(context.Background(), &VideoConfig{})
  11. common.Must(err)
  12. video := videoRaw.(*VideoChat)
  13. payload := buf.New()
  14. video.Serialize(payload.Extend(video.Size()))
  15. if payload.Len() != video.Size() {
  16. t.Error("expected payload size ", video.Size(), " but got ", payload.Len())
  17. }
  18. }