Files
bot/apps/macos/Tests/BotIPCTests/CanvasIPCTests.swift
zeekay 08582cc303 Rebrand OpenClaw → Hanzo Bot across entire codebase
Complete rename of all OpenClaw/OPENCLAW/openclaw references to
Hanzo Bot/BOT/bot naming convention:

- Env vars: OPENCLAW_* → BOT_* (18 patterns)
- Config: ~/.openclaw/ → ~/.bot/, openclaw.json → bot.json
- Packages: @openclaw/* → @hanzo/bot-*
- Domains: openclaw.ai → hanzo.bot
- Mobile: OpenClawKit → BotKit, bundle IDs ai.openclaw → ai.hanzo.bot
- mDNS: _openclaw-gw._tcp → _bot-gw._tcp
- Docker: CMD hanzo-bot.mjs, BOT_PREFER_PNPM, BOT_DOCKER_APT_PACKAGES
- CI: docker-release.yml adds :latest tag on main branch
2026-02-11 11:13:08 -08:00

42 lines
1.4 KiB
Swift

import BotIPC
import Foundation
import Testing
@Suite struct CanvasIPCTests {
@Test func canvasPresentCodableRoundtrip() throws {
let placement = CanvasPlacement(x: 10, y: 20, width: 640, height: 480)
let req: Request = .canvasPresent(session: "main", path: "/index.html", placement: placement)
let data = try JSONEncoder().encode(req)
let decoded = try JSONDecoder().decode(Request.self, from: data)
switch decoded {
case let .canvasPresent(session, path, placement):
#expect(session == "main")
#expect(path == "/index.html")
#expect(placement?.x == 10)
#expect(placement?.y == 20)
#expect(placement?.width == 640)
#expect(placement?.height == 480)
default:
Issue.record("expected canvasPresent, got \(decoded)")
}
}
@Test func canvasPresentDecodesNilPlacementWhenMissing() throws {
let json = """
{"type":"canvasPresent","session":"s","path":"/"}
"""
let decoded = try JSONDecoder().decode(Request.self, from: Data(json.utf8))
switch decoded {
case let .canvasPresent(session, path, placement):
#expect(session == "s")
#expect(path == "/")
#expect(placement == nil)
default:
Issue.record("expected canvasPresent, got \(decoded)")
}
}
}