mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-11-22 08:17:28 +00:00
Test connected nickname collisions
Split the existing PR change into a smaller reviewable piece. Original change: fix trailing commas in PeerDisplayNameResolverTests for SwiftLint
This commit is contained in:
parent
6010ebde75
commit
9c0318ea96
@ -27,6 +27,21 @@ struct PeerDisplayNameResolverTests {
|
||||
#expect(result[bob] == "bob")
|
||||
}
|
||||
|
||||
@Test func connectedCollisionSuffixesBothPeers() {
|
||||
let first = PeerID(str: "1111000000000000")
|
||||
let second = PeerID(str: "2222000000000000")
|
||||
|
||||
let result = PeerDisplayNameResolver.resolve(
|
||||
[
|
||||
(peerID: first, nickname: "sam", isConnected: true),
|
||||
(peerID: second, nickname: "sam", isConnected: true)
|
||||
],
|
||||
selfNickname: "me"
|
||||
)
|
||||
|
||||
#expect(result[first] == "sam#" + String(first.id.prefix(4)))
|
||||
#expect(result[second] == "sam#" + String(second.id.prefix(4)))
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user