()
| 169 | |
| 170 | #[test] |
| 171 | fn wrong_magic_rejected() { |
| 172 | let p = SegmentPreamble::new_wal([0u8; 4]); |
| 173 | let bytes = p.to_bytes(); |
| 174 | // Reading a WAL preamble as a SEG preamble must fail. |
| 175 | assert!(SegmentPreamble::from_bytes(&bytes, &SEG_PREAMBLE_MAGIC).is_err()); |
| 176 | } |
| 177 | |
| 178 | #[test] |
| 179 | fn unsupported_version_rejected() { |