(t *testing.T)
| 414 | } |
| 415 | |
| 416 | func TestWriteNoticeResponse(t *testing.T) { |
| 417 | var buf bytes.Buffer |
| 418 | |
| 419 | err := wire.WriteNoticeResponse(&buf, "WARNING", "01000", "some warning") |
| 420 | if err != nil { |
| 421 | t.Fatalf("wire.WriteNoticeResponse() error = %v", err) |
| 422 | } |
| 423 | |
| 424 | // Message type should be 'N' (notice) |
| 425 | if buf.Bytes()[0] != 'N' { |
| 426 | t.Errorf("message type = %c, want N", buf.Bytes()[0]) |
| 427 | } |
| 428 | |
| 429 | data := buf.Bytes()[5:] |
| 430 | if !bytes.Contains(data, []byte("SWARNING")) { |
| 431 | t.Error("should contain severity WARNING") |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | func TestMessageRoundTrip(t *testing.T) { |
| 436 | // Test that we can write a message and read it back |
nothing calls this directly
no test coverage detected