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
45 lines
1.1 KiB
Swift
45 lines
1.1 KiB
Swift
import HanzoBotProtocol
|
|
import Foundation
|
|
import Testing
|
|
@testable import HanzoBot
|
|
|
|
@Suite
|
|
@MainActor
|
|
struct AgentEventStoreTests {
|
|
@Test
|
|
func appendAndClear() {
|
|
let store = AgentEventStore()
|
|
#expect(store.events.isEmpty)
|
|
|
|
store.append(ControlAgentEvent(
|
|
runId: "run",
|
|
seq: 1,
|
|
stream: "test",
|
|
ts: 0,
|
|
data: [:] as [String: HanzoBotProtocol.AnyCodable],
|
|
summary: nil))
|
|
#expect(store.events.count == 1)
|
|
|
|
store.clear()
|
|
#expect(store.events.isEmpty)
|
|
}
|
|
|
|
@Test
|
|
func trimsToMaxEvents() {
|
|
let store = AgentEventStore()
|
|
for i in 1...401 {
|
|
store.append(ControlAgentEvent(
|
|
runId: "run",
|
|
seq: i,
|
|
stream: "test",
|
|
ts: Double(i),
|
|
data: [:] as [String: HanzoBotProtocol.AnyCodable],
|
|
summary: nil))
|
|
}
|
|
|
|
#expect(store.events.count == 400)
|
|
#expect(store.events.first?.seq == 2)
|
|
#expect(store.events.last?.seq == 401)
|
|
}
|
|
}
|