()
| 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 | } |
nothing calls this directly
no test coverage detected