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

Function valid_insert_accepted

nodedb-crdt/src/validator/tests.rs:22–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20
21#[test]
22fn valid_insert_accepted() {
23 let (state, cs) = setup();
24 let validator = Validator::new(cs, 100);
25
26 let change = ProposedChange {
27 collection: "users".into(),
28 row_id: "u1".into(),
29 surrogate: nodedb_types::Surrogate::ZERO,
30 fields: vec![
31 ("name".into(), LoroValue::String("Alice".into())),
32 (
33 "email".into(),
34 LoroValue::String("alice@example.com".into()),
35 ),
36 ],
37 };
38
39 assert!(matches!(
40 validator.validate(&state, &change),
41 ValidationOutcome::Accepted
42 ));
43}
44
45#[test]
46fn not_null_violation() {

Callers

nothing calls this directly

Calls 1

setupFunction · 0.70

Tested by

no test coverage detected