mirror of
https://github.com/hanzoai/bot.git
synced 2026-11-01 07:38:30 +00:00
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
29 lines
990 B
Swift
29 lines
990 B
Swift
import Testing
|
|
@testable import Hanzo Bot
|
|
|
|
@MainActor
|
|
@Suite struct TalkModeIncrementalSpeechBufferTests {
|
|
@Test func emitsSoftBoundaryBeforeTerminalPunctuation() {
|
|
let manager = TalkModeManager(allowSimulatorCapture: true)
|
|
manager._test_incrementalReset()
|
|
|
|
let partial =
|
|
"We start speaking earlier by splitting this long stream chunk at a whitespace boundary before punctuation arrives"
|
|
let segments = manager._test_incrementalIngest(partial, isFinal: false)
|
|
|
|
#expect(segments.count == 1)
|
|
#expect(segments[0].count >= 72)
|
|
#expect(segments[0].count < partial.count)
|
|
}
|
|
|
|
@Test func keepsShortChunkBufferedWithoutPunctuation() {
|
|
let manager = TalkModeManager(allowSimulatorCapture: true)
|
|
manager._test_incrementalReset()
|
|
|
|
let short = "short chunk without punctuation"
|
|
let segments = manager._test_incrementalIngest(short, isFinal: false)
|
|
|
|
#expect(segments.isEmpty)
|
|
}
|
|
}
|