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

Function apply_rejects_invalid_shape

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

Source from the content-addressed store, hash-verified

376
377 #[test]
378 fn apply_rejects_invalid_shape() {
379 let mut engine = MockEngine::new();
380 engine.register_array("a", hlc(100));
381 // Put op with no attrs is invalid.
382 let op = ArrayOp {
383 header: header("a", 50, 100),
384 kind: ArrayOpKind::Put,
385 coord: vec![CoordValue::Int64(1)],
386 attrs: None,
387 };
388 let outcome = apply_op(&mut engine, &op).unwrap();
389 assert!(matches!(
390 outcome,
391 ApplyOutcome::Rejected(ApplyRejection::ShapeInvalid { .. })
392 ));
393 }
394
395 #[test]
396 fn apply_wraps_engine_error_as_rejection() {

Callers

nothing calls this directly

Calls 4

apply_opFunction · 0.85
register_arrayMethod · 0.80
hlcFunction · 0.70
headerFunction · 0.70

Tested by

no test coverage detected