X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=room_test.go;h=d5bf41180549eb7485087faf19b12f6dd94f902e;hb=e80115cf6921d4fc2d64b3b809c76a5019f82309;hp=6bd1cb06464af365622445d515a661ac78f36e91;hpb=4f5fa5132780b50c7f2b51329b2a68d3cbbff939;p=goircd.git diff --git a/room_test.go b/room_test.go index 6bd1cb0..d5bf411 100644 --- a/room_test.go +++ b/room_test.go @@ -1,3 +1,21 @@ +/* +goircd -- minimalistic simple Internet Relay Chat (IRC) server +Copyright (C) 2014-2015 Sergey Matveev + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + package main import ( @@ -26,14 +44,15 @@ func notEnoughParams(t *testing.T, c *TestingConn) { func TestTwoUsers(t *testing.T) { logSink := make(chan LogEvent, 8) stateSink := make(chan StateEvent, 8) - daemon := NewDaemon("ver1", "foohost", "", logSink, stateSink) + host := "foohost" + daemon := NewDaemon("ver1", &host, nil, nil, logSink, stateSink) events := make(chan ClientEvent) go daemon.Processor(events) conn1 := NewTestingConn() conn2 := NewTestingConn() - client1 := NewClient("foohost", conn1) - client2 := NewClient("foohost", conn2) + client1 := NewClient(&host, conn1) + client2 := NewClient(&host, conn2) go client1.Processor(events) go client2.Processor(events) @@ -100,11 +119,12 @@ func TestTwoUsers(t *testing.T) { func TestJoin(t *testing.T) { logSink := make(chan LogEvent, 8) stateSink := make(chan StateEvent, 8) - daemon := NewDaemon("ver1", "foohost", "", logSink, stateSink) + host := "foohost" + daemon := NewDaemon("ver1", &host, nil, nil, logSink, stateSink) events := make(chan ClientEvent) go daemon.Processor(events) conn := NewTestingConn() - client := NewClient("foohost", conn) + client := NewClient(&host, conn) go client.Processor(events) conn.inbound <- "NICK nick2\r\nUSER foo2 bar2 baz2 :Long name2\r\n"