MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / collision_only_identity_vectors

Function collision_only_identity_vectors

codegraph-kernel/src/ids.rs:74–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72
73 #[test]
74 fn collision_only_identity_vectors() {
75 let mut ids = NodeIdAllocator::default();
76 let base = "function:bfb15544fed707794274a5c61006ea7b";
77 for (column, expected) in [
78 (2, base.to_string()),
79 (24, format!("{base}:24")),
80 (48, format!("{base}:48")),
81 (24, format!("{base}:24")),
82 (2, base.to_string()),
83 ] {
84 assert_eq!(
85 ids.generate("src/a.ts", "function", "foo", 3, column),
86 expected
87 );
88 }
89 assert_eq!(
90 ids.generate("src/b.ts", "function", "foo", 3, 24),
91 node_id("src/b.ts", "function", "foo", 3)
92 );
93 assert_eq!(
94 NodeIdAllocator::default().generate("src/a.ts", "function", "foo", 3, 24),
95 base
96 );
97 }
98
99 #[test]
100 fn matches_known_ts_output() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected