MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / node_names_are_unprefixed

Function node_names_are_unprefixed

nodedb-graph/src/sharded.rs:231–248  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

229
230 #[test]
231 fn node_names_are_unprefixed() {
232 let mut sharded = ShardedCsrIndex::new();
233 sharded
234 .get_or_create(tid(42))
235 .add_edge("alice", "knows", "bob")
236 .unwrap();
237 sharded
238 .get_or_create(tid(42))
239 .compact()
240 .expect("no governor, cannot fail");
241
242 let part = sharded.partition(tid(42)).unwrap();
243 let alice_id = part.node_id("alice").expect("alice must be present");
244 // The stored name is exactly what the caller inserted — never
245 // `"42:alice"`. Structural partitioning keeps shard ids out of
246 // user-visible keys.
247 assert_eq!(part.node_name(alice_id), "alice");
248 }
249
250 #[test]
251 fn drop_partition_removes_tenant_state() {

Callers

nothing calls this directly

Calls 7

tidFunction · 0.85
add_edgeMethod · 0.80
get_or_createMethod · 0.45
expectMethod · 0.45
compactMethod · 0.45
partitionMethod · 0.45
node_idMethod · 0.45

Tested by

no test coverage detected