mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-11-29 08:29:22 +00:00
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:
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])
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user