mirror of
https://github.com/pion/ice.git
synced 2026-04-22 16:17:11 +08:00
cdbf668b03
Update lint scripts and CI configs.
25 lines
603 B
Go
25 lines
603 B
Go
// SPDX-FileCopyrightText: 2026 The Pion community <https://pion.ly>
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package ice
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/pion/stun/v3"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestUseCandidateAttr_AddTo(t *testing.T) {
|
|
msg := stun.New()
|
|
msg.Type = stun.MessageType{Method: stun.MethodBinding, Class: stun.ClassRequest}
|
|
require.False(t, UseCandidate().IsSet(msg))
|
|
|
|
require.NoError(t, UseCandidate().AddTo(msg))
|
|
msg.Encode()
|
|
|
|
msg2 := &stun.Message{Raw: append([]byte{}, msg.Raw...)}
|
|
require.NoError(t, msg2.Decode())
|
|
require.True(t, UseCandidate().IsSet(msg2))
|
|
}
|