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

Function test_trunk_id_encoding_ordering

atomic-core/src/crdt/tables.rs:805–816  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

803
804 #[test]
805 fn test_trunk_id_encoding_ordering() {
806 let id1 = TrunkId::new(NodeId::new(1), 0);
807 let id2 = TrunkId::new(NodeId::new(1), 1);
808 let id3 = TrunkId::new(NodeId::new(2), 0);
809
810 let bytes1 = encode_trunk_id(&id1);
811 let bytes2 = encode_trunk_id(&id2);
812 let bytes3 = encode_trunk_id(&id3);
813
814 assert!(bytes1 < bytes2, "same change, lower idx should sort first");
815 assert!(bytes2 < bytes3, "lower change_id should sort first");
816 }
817
818 #[test]
819 fn test_branch_id_encoding_roundtrip() {

Callers

nothing calls this directly

Calls 1

encode_trunk_idFunction · 0.85

Tested by

no test coverage detected