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

Function apply_wraps_engine_error_as_rejection

nodedb-array/src/sync/apply.rs:396–410  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

394
395 #[test]
396 fn apply_wraps_engine_error_as_rejection() {
397 let mut engine = MockEngine::new();
398 engine.register_array("a", hlc(100));
399 engine.set_reject_next(ArrayError::InvalidOp {
400 detail: "simulated engine error".into(),
401 });
402 let op = put_op("a", 50, 100);
403 let outcome = apply_op(&mut engine, &op).unwrap();
404 assert!(matches!(
405 outcome,
406 ApplyOutcome::Rejected(ApplyRejection::EngineRejected { .. })
407 ));
408 // No tile invalidation on rejection.
409 assert!(engine.invalidated.is_empty());
410 }
411
412 #[test]
413 fn apply_invalidates_tile_after_success() {

Callers

nothing calls this directly

Calls 5

apply_opFunction · 0.85
register_arrayMethod · 0.80
set_reject_nextMethod · 0.80
hlcFunction · 0.70
put_opFunction · 0.70

Tested by

no test coverage detected