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

Function pre_validate_proceeds_when_valid

nodedb-crdt/src/pre_validate.rs:80–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78
79 #[test]
80 fn pre_validate_proceeds_when_valid() {
81 let state = CrdtState::new(1).unwrap();
82 let mut cs = ConstraintSet::new();
83 cs.add_not_null("name_nn", "users", "name");
84 let validator = Validator::new(cs, 10);
85
86 let change = ProposedChange {
87 collection: "users".into(),
88 row_id: "u1".into(),
89 surrogate: nodedb_types::Surrogate::ZERO,
90 fields: vec![("name".into(), LoroValue::String("Alice".into()))],
91 };
92
93 assert!(matches!(
94 pre_validate(&validator, &state, &change),
95 PreValidationResult::Proceed
96 ));
97 }
98}

Callers

nothing calls this directly

Calls 1

add_not_nullMethod · 0.80

Tested by

no test coverage detected