(t *testing.T)
| 248 | } |
| 249 | |
| 250 | func TestWithLocalCredentials(t *testing.T) { |
| 251 | password := strings.Repeat("p", 16) |
| 252 | |
| 253 | agent, err := NewAgentWithOptions(WithLocalCredentials("abcd", password)) |
| 254 | require.NoError(t, err) |
| 255 | defer agent.Close() //nolint:errcheck |
| 256 | |
| 257 | assert.Equal(t, "abcd", agent.localUfrag) |
| 258 | assert.Equal(t, password, agent.localPwd) |
| 259 | |
| 260 | _, err = NewAgentWithOptions(WithLocalCredentials("ab", password)) |
| 261 | assert.ErrorIs(t, err, ErrLocalUfragInsufficientBits) |
| 262 | |
| 263 | shortPassword := strings.Repeat("p", 10) |
| 264 | _, err = NewAgentWithOptions(WithLocalCredentials("abcd", shortPassword)) |
| 265 | assert.ErrorIs(t, err, ErrLocalPwdInsufficientBits) |
| 266 | } |
| 267 | |
| 268 | func TestWithMuxOptions(t *testing.T) { |
| 269 | tcpMux := &stubTCPMux{} |
nothing calls this directly
no test coverage detected
searching dependent graphs…