File: tcptype_test.go

package info (click to toggle)
golang-github-pion-ice.v2 2.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 684 kB
  • sloc: makefile: 5
file content (23 lines) | stat: -rw-r--r-- 677 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package ice

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestTCPType(t *testing.T) {
	var tcpType TCPType

	assert.Equal(t, TCPTypeUnspecified, tcpType)
	assert.Equal(t, TCPTypeActive, NewTCPType("active"))
	assert.Equal(t, TCPTypePassive, NewTCPType("passive"))
	assert.Equal(t, TCPTypeSimultaneousOpen, NewTCPType("so"))
	assert.Equal(t, TCPTypeUnspecified, NewTCPType("something else"))

	assert.Equal(t, "", TCPTypeUnspecified.String())
	assert.Equal(t, "active", TCPTypeActive.String())
	assert.Equal(t, "passive", TCPTypePassive.String())
	assert.Equal(t, "so", TCPTypeSimultaneousOpen.String())
	assert.Equal(t, "Unknown", TCPType(-1).String())
}