MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_outcome_with_conflicts

Function test_outcome_with_conflicts

atomic-core/src/crdt/apply/context.rs:1089–1103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1087
1088 #[test]
1089 fn test_outcome_with_conflicts() {
1090 use super::super::conflict::{ConflictKind, CrdtConflict};
1091
1092 let options = ApplyOptions::builder().fail_on_conflict(false).build();
1093 let mut context = ApplyContext::new(options);
1094
1095 let conflict = CrdtConflict::new(ConflictKind::ConcurrentInsert, "test".to_string());
1096 context.add_conflict(conflict);
1097
1098 let outcome = context.finish();
1099
1100 assert!(outcome.is_success()); // success because fail_on_conflict is false
1101 assert!(outcome.has_conflicts());
1102 assert_eq!(outcome.conflict_count(), 1);
1103 }
1104
1105 #[test]
1106 fn test_outcome_into_stats() {

Callers

nothing calls this directly

Calls 4

fail_on_conflictMethod · 0.80
buildMethod · 0.45
add_conflictMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected