test(语音日记): 端侧识别可用性探测冒烟测试(模拟器降级路径)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
13
康康Tests/SpeechDictationAvailabilityTests.swift
Normal file
13
康康Tests/SpeechDictationAvailabilityTests.swift
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import Testing
|
||||||
|
@testable import 康康
|
||||||
|
|
||||||
|
struct SpeechDictationAvailabilityTests {
|
||||||
|
/// 模拟器冒烟:isAvailable 的探测路径(SFSpeechRecognizer 构造 + supportsOnDeviceRecognition)
|
||||||
|
/// 不许崩溃、不许卡死;模拟器多为 false(mic 按钮隐藏),个别 Xcode/macOS 组合为 true 也合法,
|
||||||
|
/// 所以只断言「可重复调用且结果稳定」,不断言具体值。
|
||||||
|
@Test func isAvailableProbeIsStableAndDoesNotCrash() {
|
||||||
|
let first = SpeechDictationService.isAvailable
|
||||||
|
let second = SpeechDictationService.isAvailable
|
||||||
|
#expect(first == second)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user