f0240c3088
- Accumulate utterance PCM in FlowContinuousCapture for batch retry - Run full-utterance transcribeChunk when stitched final lags partial - Refactor Mac MLX tail drain to shared FlowUtteranceEndCoordinator - Add FlowUtterancePCMStore, UtteranceBatchFallbackPolicy, and tests Co-authored-by: Rocky <hkgood@users.noreply.github.com>
24 lines
674 B
Swift
24 lines
674 B
Swift
// FlowUtterancePCMStoreTests.swift
|
|
// OSGKeyboardTests
|
|
|
|
import XCTest
|
|
@testable import OSGKeyboardShared
|
|
|
|
final class FlowUtterancePCMStoreTests: XCTestCase {
|
|
|
|
func testAppendAndConsume() {
|
|
let store = FlowUtterancePCMStore(maxSampleCount: 100)
|
|
store.append([1, 2, 3])
|
|
store.append([4, 5])
|
|
XCTAssertEqual(store.sampleCount, 5)
|
|
XCTAssertEqual(store.consume(), [1, 2, 3, 4, 5])
|
|
XCTAssertEqual(store.sampleCount, 0)
|
|
}
|
|
|
|
func testTrimsOldestWhenOverCap() {
|
|
let store = FlowUtterancePCMStore(maxSampleCount: 4)
|
|
store.append([1, 2, 3, 4, 5])
|
|
XCTAssertEqual(store.consume(), [2, 3, 4, 5])
|
|
}
|
|
}
|