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

Function test_context_add_conflict

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

Source from the content-addressed store, hash-verified

979
980 #[test]
981 fn test_context_add_conflict() {
982 use super::super::conflict::{ConflictKind, CrdtConflict};
983
984 let options = ApplyOptions::builder().fail_on_conflict(false).build();
985 let mut context = ApplyContext::new(options);
986
987 let conflict =
988 CrdtConflict::new(ConflictKind::ConcurrentInsert, "test conflict".to_string());
989 context.add_conflict(conflict);
990
991 assert!(context.has_conflicts());
992 assert_eq!(context.conflict_count(), 1);
993 assert!(!context.has_failed()); // fail_on_conflict is false
994 }
995
996 #[test]
997 fn test_context_add_conflict_with_fail() {

Callers

nothing calls this directly

Calls 3

fail_on_conflictMethod · 0.80
buildMethod · 0.45
add_conflictMethod · 0.45

Tested by

no test coverage detected