Test composed and decomposed mention forms

Split the existing PR change into a smaller reviewable piece.
Original change: fix(composer): accept combining marks in @mention regex
This commit is contained in:
Taksh committed 2026-10-05 16:10:52 +05:30
1 parent e6953f4ef5
commit c6a747ac13
1 file changed
+12
@@ -192,4 +192,16 @@ struct ChatComposerCoordinatorContextTests {
)
#expect(Set(mentions) == ["alice", "me", "me#0011"])
}
@Test @MainActor
func parseMentions_matchesUnicodeEquivalentNicknames() {
let context = MockChatComposerContext()
let coordinator = ChatComposerCoordinator(context: context)
let precomposed = "caf\u{00E9}"
let decomposed = "cafe\u{0301}"
context.meshNicknamesByPeerID = [PeerID(str: "1111111111111111"): precomposed]
let mentions = coordinator.parseMentions(from: "hi @\(decomposed)")
#expect(mentions == [precomposed])
}
}