X-Git-Url: http://www.git.cypherpunks.ru/?p=goircd.git;a=blobdiff_plain;f=daemon_test.go;h=9c9db3de436923a43540debbc7d582374db58a43;hp=1c86f351d819816682b095d063d5f98116471d35;hb=41f96494948d1f9f1e0c3066099e0bd9ad0ee8dd;hpb=c1d256aaa0af4e0cb3649552e5067a9ec3bc94d5 diff --git a/daemon_test.go b/daemon_test.go index 1c86f35..9c9db3d 100644 --- a/daemon_test.go +++ b/daemon_test.go @@ -113,10 +113,10 @@ func TestRegistrationWorkflow(t *testing.T) { func TestMotd(t *testing.T) { fd, err := ioutil.TempFile("", "motd") if err != nil { - t.Fatal("can not create temporary file") + t.Fatalf("can not create temporary file: %v", err) } defer os.Remove(fd.Name()) - fd.Write([]byte("catched\n")) + fd.WriteString("catched\n") conn := NewTestingConn() client := NewClient("foohost", conn) @@ -129,7 +129,7 @@ func TestMotd(t *testing.T) { if r := <-conn.outbound; !strings.Contains(r, "372 * :- catched\r\n") { t.Fatal("MOTD contents", r) } - if r := <-conn.outbound; !strings.HasPrefix(r, ":foohost 376") { - t.Fatal("MOTD end", r) + if got, want := <-conn.outbound, ":foohost 376"; !strings.HasPrefix(got, want) { + t.Fatalf("MOTD end: got %q, want prefix %q", got, want) } }