~samwhited/xmpp

8bbebffa4f4fda0dde5e4bf5a0f7082f84aded3b — Sam Whited 3 years ago 323d7cb
Fix partially useless tests

Also remove some weird duplicate tests; no idea what I did here.
3 files changed, 4 insertions(+), 22 deletions(-)

M config_test.go
M dial_test.go
M doc.go
M config_test.go => config_test.go +0 -16
@@ 8,22 8,6 @@ import (
	"testing"
)

// The default value of config.conntype should return "xmpp-client"
func TestDefaultSessionType(t *testing.T) {
	c := &Config{}
	if ct := connType(c.S2S); ct != "xmpp-client" {
		t.Errorf("Wrong default value for conntype; expected xmpp-client but got %s", ct)
	}
}

// If S2S is true, config.conntype should return "xmpp-server"
func TestS2SSessionType(t *testing.T) {
	c := &Config{S2S: true}
	if ct := connType(c.S2S); ct != "xmpp-server" {
		t.Errorf("Wrong s2s value for conntype; expected xmpp-server but got %s", ct)
	}
}

// New configs should populate the features map with no duplicates.
func TestNewConfigShouldPopulateFeatures(t *testing.T) {
	c := NewServerConfig(nil, nil, BindResource(), BindResource(), StartTLS(true))

M dial_test.go => dial_test.go +2 -4
@@ 21,16 21,14 @@ func TestDialClientPanicsIfNilContext(t *testing.T) {

// The default value of config.conntype should return "xmpp-client"
func TestDefaultConnType(t *testing.T) {
	c := &Config{}
	if ct := connType(c.S2S); ct != "xmpp-client" {
	if ct := connType(false); ct != "xmpp-client" {
		t.Errorf("Wrong default value for conntype; expected xmpp-client but got %s", ct)
	}
}

// If S2S is true, config.conntype should return "xmpp-server"
func TestS2SConnType(t *testing.T) {
	c := &Config{S2S: true}
	if ct := connType(c.S2S); ct != "xmpp-server" {
	if ct := connType(true); ct != "xmpp-server" {
		t.Errorf("Wrong s2s value for conntype; expected xmpp-server but got %s", ct)
	}
}

M doc.go => doc.go +2 -2
@@ 1,6 1,6 @@
// Copyright 2014 Sam Whited.
// Use of this source code is governed by the BSD 2-clause license that can be
// found in the LICENSE file.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.

// Package xmpp provides functionality from the Extensible Messaging and
// Presence Protocol.