MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / assert_no_duplicates

Function assert_no_duplicates

tests/integration/references.rs:109–127  ·  view source on GitHub ↗

Helper to assert no duplicate locations exist in the results.

(results: &[tower_lsp::lsp_types::Location], label: &str)

Source from the content-addressed store, hash-verified

107
108/// Helper to assert no duplicate locations exist in the results.
109fn assert_no_duplicates(results: &[tower_lsp::lsp_types::Location], label: &str) {
110 let mut seen = std::collections::HashSet::new();
111 for loc in results {
112 let key = format!(
113 "{}:{}:{}:{}:{}",
114 loc.uri,
115 loc.range.start.line,
116 loc.range.start.character,
117 loc.range.end.line,
118 loc.range.end.character,
119 );
120 assert!(
121 seen.insert(key.clone()),
122 "Duplicate reference found ({}): {}",
123 label,
124 key
125 );
126 }
127}
128
129// ─── Class reference tests ──────────────────────────────────────────────────
130

Calls

no outgoing calls