|
@ -3,18 +3,15 @@ package irc_test |
|
|
import ( |
|
|
import ( |
|
|
"context" |
|
|
"context" |
|
|
"errors" |
|
|
"errors" |
|
|
|
|
|
"github.com/gissleh/irc/handlers" |
|
|
"testing" |
|
|
"testing" |
|
|
|
|
|
|
|
|
"github.com/gissleh/irc" |
|
|
"github.com/gissleh/irc" |
|
|
"github.com/gissleh/irc/handlers" |
|
|
|
|
|
"github.com/gissleh/irc/internal/irctest" |
|
|
"github.com/gissleh/irc/internal/irctest" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
// Integration test below, brace yourself.
|
|
|
// Integration test below, brace yourself.
|
|
|
func TestClient(t *testing.T) { |
|
|
func TestClient(t *testing.T) { |
|
|
irc.AddHandler(handlers.Input) |
|
|
|
|
|
irc.AddHandler(handlers.MRoleplay) |
|
|
|
|
|
|
|
|
|
|
|
client := irc.New(context.Background(), irc.Config{ |
|
|
client := irc.New(context.Background(), irc.Config{ |
|
|
Nick: "Test", |
|
|
Nick: "Test", |
|
|
User: "Tester", |
|
|
User: "Tester", |
|
@ -23,6 +20,9 @@ func TestClient(t *testing.T) { |
|
|
SendRate: 1000, |
|
|
SendRate: 1000, |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
client.AddHandler(handlers.Input) |
|
|
|
|
|
client.AddHandler(handlers.MRoleplay) |
|
|
|
|
|
|
|
|
t.Logf("Client.ID = %#+v", client.ID()) |
|
|
t.Logf("Client.ID = %#+v", client.ID()) |
|
|
if client.ID() == "" { |
|
|
if client.ID() == "" { |
|
|
t.Fail() |
|
|
t.Fail() |
|
|