(t *testing.T)
| 232 | } |
| 233 | |
| 234 | func TestWriteAuthOK(t *testing.T) { |
| 235 | var buf bytes.Buffer |
| 236 | |
| 237 | err := wire.WriteAuthOK(&buf) |
| 238 | if err != nil { |
| 239 | t.Fatalf("wire.WriteAuthOK() error = %v", err) |
| 240 | } |
| 241 | |
| 242 | // Message type should be 'R' |
| 243 | if buf.Bytes()[0] != 'R' { |
| 244 | t.Errorf("message type = %c, want R", buf.Bytes()[0]) |
| 245 | } |
| 246 | |
| 247 | // Length should be 8 (4 for length + 4 for auth type) |
| 248 | length := binary.BigEndian.Uint32(buf.Bytes()[1:5]) |
| 249 | if length != 8 { |
| 250 | t.Errorf("length = %d, want 8", length) |
| 251 | } |
| 252 | |
| 253 | // Auth type should be 0 (OK) |
| 254 | authType := binary.BigEndian.Uint32(buf.Bytes()[5:9]) |
| 255 | if authType != 0 { |
| 256 | t.Errorf("auth type = %d, want 0", authType) |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | func TestWriteAuthCleartextPassword(t *testing.T) { |
| 261 | var buf bytes.Buffer |
nothing calls this directly
no test coverage detected