mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Comprehensive rename of all openclaw references to hanzo-bot equivalents: - Package: openclaw → @hanzo/bot - Binary: openclaw → hanzo-bot - Types: OpenClaw* → Bot* - Env vars: OPENCLAW_* → BOT_* - Android: ai.openclaw.android → ai.hanzo.bot.android - iOS/macOS: ai.openclaw.* → ai.hanzo.* - Swift modules: OpenClaw* → Bot* - Plugins: openclaw.plugin.json → bot.plugin.json - Paths: .openclaw/ → .hanzo/bot/ - URLs: github.com/openclaw → github.com/hanzoai
34 lines
1.2 KiB
Swift
34 lines
1.2 KiB
Swift
import BotKit
|
|
import Network
|
|
import Testing
|
|
@testable import HanzoBot
|
|
|
|
@Suite struct GatewayEndpointIDTests {
|
|
@Test func stableIDForServiceDecodesAndNormalizesName() {
|
|
let endpoint = NWEndpoint.service(
|
|
name: "HanzoBot\\032Gateway \\032 Node\n",
|
|
type: "_bot-gw._tcp",
|
|
domain: "local.",
|
|
interface: nil)
|
|
|
|
#expect(GatewayEndpointID.stableID(endpoint) == "_bot-gw._tcp|local.|HanzoBot Gateway Node")
|
|
}
|
|
|
|
@Test func stableIDForNonServiceUsesEndpointDescription() {
|
|
let endpoint = NWEndpoint.hostPort(host: NWEndpoint.Host("127.0.0.1"), port: 4242)
|
|
#expect(GatewayEndpointID.stableID(endpoint) == String(describing: endpoint))
|
|
}
|
|
|
|
@Test func prettyDescriptionDecodesBonjourEscapes() {
|
|
let endpoint = NWEndpoint.service(
|
|
name: "HanzoBot\\032Gateway",
|
|
type: "_bot-gw._tcp",
|
|
domain: "local.",
|
|
interface: nil)
|
|
|
|
let pretty = GatewayEndpointID.prettyDescription(endpoint)
|
|
#expect(pretty == BonjourEscapes.decode(String(describing: endpoint)))
|
|
#expect(!pretty.localizedCaseInsensitiveContains("\\032"))
|
|
}
|
|
}
|