mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-11 01:50:46 +08:00
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
28 lines
989 B
Swift
28 lines
989 B
Swift
import Testing
|
|
@testable import OpenClaw
|
|
|
|
@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)
|
|
}
|
|
}
|