()
| 321 | |
| 322 | #[test] |
| 323 | fn import_garbage_errors() { |
| 324 | let g = generator(1); |
| 325 | let mut doc = SchemaDoc::new(replica(1)); |
| 326 | // Prefix with a valid version byte so we get past the envelope check |
| 327 | // and into Loro's own parser — which should reject the payload. |
| 328 | let mut bad = vec![LORO_FORMAT_VERSION]; |
| 329 | bad.extend_from_slice(b"not valid loro data"); |
| 330 | let result = doc.import_snapshot(&bad, Hlc::ZERO, &g); |
| 331 | assert!(result.is_err()); |
| 332 | } |
| 333 | |
| 334 | #[test] |
| 335 | fn export_snapshot_has_version_prefix() { |
nothing calls this directly
no test coverage detected