~samwhited/xmpp

ref: 2c0e7c9330381825e8bf9c8aa48df4f19823689c xmpp/dial_test.go -rw-r--r-- 442 bytes
2c0e7c93Sam Whited Minor function refactor 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright 2016 Sam Whited.
// Use of this source code is governed by the BSD 2-clause license that can be
// found in the LICENSE file.

package xmpp

import (
	"testing"

	"mellium.im/xmpp/jid"
)

func TestDialClientPanicsIfNilContext(t *testing.T) {
	defer func() {
		if r := recover(); r == nil {
			t.Error("Expected Dial to panic when passed a nil context.")
		}
	}()
	DialClient(nil, "tcp", jid.MustParse("feste@shakespeare.lit"))
}