(t *testing.T)
| 63 | } |
| 64 | |
| 65 | func TestShutdownMessage(t *testing.T) { |
| 66 | var buf bytes.Buffer |
| 67 | |
| 68 | // Write shutdown |
| 69 | if err := WriteShutdown(&buf); err != nil { |
| 70 | t.Fatalf("WriteShutdown failed: %v", err) |
| 71 | } |
| 72 | |
| 73 | // Read it back |
| 74 | opcode, _, err := ReadControlMessage(&buf) |
| 75 | if err != nil { |
| 76 | t.Fatalf("ReadControlMessage failed: %v", err) |
| 77 | } |
| 78 | |
| 79 | if opcode != OpShutdown { |
| 80 | t.Errorf("Expected OpShutdown (0x%02x), got 0x%02x", OpShutdown, opcode) |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | func TestUnknownOpcode(t *testing.T) { |
| 85 | var buf bytes.Buffer |
nothing calls this directly
no test coverage detected