MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / import_garbage_errors

Function import_garbage_errors

nodedb-array/src/sync/schema_crdt.rs:323–332  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 3

generatorFunction · 0.85
replicaFunction · 0.70
import_snapshotMethod · 0.45

Tested by

no test coverage detected