(t *testing.T)
| 40 | } |
| 41 | |
| 42 | func TestPongMessage(t *testing.T) { |
| 43 | var buf bytes.Buffer |
| 44 | testNonce := uint64(12345) |
| 45 | |
| 46 | // Write pong |
| 47 | if err := WritePong(&buf, testNonce); err != nil { |
| 48 | t.Fatalf("WritePong failed: %v", err) |
| 49 | } |
| 50 | |
| 51 | // Read it back |
| 52 | opcode, nonce, err := ReadControlMessage(&buf) |
| 53 | if err != nil { |
| 54 | t.Fatalf("ReadControlMessage failed: %v", err) |
| 55 | } |
| 56 | |
| 57 | if opcode != OpPong { |
| 58 | t.Errorf("Expected OpPong (0x%02x), got 0x%02x", OpPong, opcode) |
| 59 | } |
| 60 | if nonce != testNonce { |
| 61 | t.Errorf("Expected nonce %d, got %d", testNonce, nonce) |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | func TestShutdownMessage(t *testing.T) { |
| 66 | var buf bytes.Buffer |
nothing calls this directly
no test coverage detected