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

Function test_ordering_entry_ord

atomic-core/src/crdt/apply/order.rs:578–589  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

576
577 #[test]
578 fn test_ordering_entry_ord() {
579 let entry1: OrderingEntry<i32> = OrderingEntry::new(1, None);
580 let entry2: OrderingEntry<i32> = OrderingEntry::new(5, None);
581 let entry3: OrderingEntry<i32> = OrderingEntry::new(5, Some(1));
582
583 // Ord comparison is by ID only
584 assert!(entry1 < entry2);
585 assert!(entry2.cmp(&entry3) == std::cmp::Ordering::Equal);
586
587 // But PartialEq compares all fields (derived)
588 assert!(entry2 != entry3); // Different "after" references
589 }
590
591 #[test]
592 fn test_ordering_entry_serde() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected