()
| 1734 | |
| 1735 | #[test] |
| 1736 | fn completions_no_duplicates() { |
| 1737 | let content = "<?php\n/**\n * @\n */\n\n"; |
| 1738 | let pos = Position { |
| 1739 | line: 2, |
| 1740 | character: 4, |
| 1741 | }; |
| 1742 | let items = build_phpdoc_completions( |
| 1743 | content, |
| 1744 | "@", |
| 1745 | DocblockContext::Unknown, |
| 1746 | pos, |
| 1747 | &std::collections::HashMap::new(), |
| 1748 | &None, |
| 1749 | &SmartContext::EMPTY, |
| 1750 | ); |
| 1751 | let filter_texts: Vec<&str> = items |
| 1752 | .iter() |
| 1753 | .filter_map(|i| i.filter_text.as_deref()) |
| 1754 | .collect(); |
| 1755 | let unique: std::collections::HashSet<&&str> = filter_texts.iter().collect(); |
| 1756 | assert_eq!( |
| 1757 | filter_texts.len(), |
| 1758 | unique.len(), |
| 1759 | "Should not have duplicate tags. Got: {:?}", |
| 1760 | filter_texts |
| 1761 | ); |
| 1762 | } |
| 1763 | |
| 1764 | // ── Smart pre-fill tests ──────────────────────────────────────── |
| 1765 |
nothing calls this directly
no test coverage detected