Files
bot/apps/macos/Tests/OpenClawIPCTests/AgentEventStoreTests.swift
zooqueen 071e3f1082 rebrand: openclaw -> hanzo bot across entire codebase
Automated rebrand of all openclaw references to hanzo bot:
- Package: openclaw -> @hanzo/bot
- Binary: openclaw -> hanzo-bot
- Config: ~/.openclaw -> ~/.hanzo/bot
- Docker: ghcr.io/hanzoai/bot
- Env vars: OPENCLAW_* -> BOT_*
- Bundle IDs: ai.hanzo.bot.*
- Product name: Hanzo Bot
2026-03-19 13:52:32 -07:00

44 lines
1.1 KiB
Swift

import Foundation
import Hanzo BotProtocol
import Testing
@testable import Hanzo Bot
@MainActor
struct AgentEventStoreTests {
@Test
func `append and clear`() {
let store = AgentEventStore()
#expect(store.events.isEmpty)
store.append(ControlAgentEvent(
runId: "run",
seq: 1,
stream: "test",
ts: 0,
data: [:] as [String: Hanzo BotProtocol.AnyCodable],
summary: nil))
#expect(store.events.count == 1)
store.clear()
#expect(store.events.isEmpty)
}
@Test
func `trims to max events`() {
let store = AgentEventStore()
for i in 1...401 {
store.append(ControlAgentEvent(
runId: "run",
seq: i,
stream: "test",
ts: Double(i),
data: [:] as [String: Hanzo BotProtocol.AnyCodable],
summary: nil))
}
#expect(store.events.count == 400)
#expect(store.events.first?.seq == 2)
#expect(store.events.last?.seq == 401)
}
}