498f407585
Introduce optional Apple account-backed credits with scoped gateway access while preserving local and BYOK paths. Refresh assistant behavior, tests, privacy disclosures, docs, and the website for the 2.0 experience.
41 lines
1.4 KiB
Swift
41 lines
1.4 KiB
Swift
// FlowASRPostProcessorTests.swift
|
|
// OSGKeyboardTests
|
|
|
|
@testable import OSGKeyboard
|
|
@testable import OSGKeyboardShared
|
|
import XCTest
|
|
|
|
final class FlowASRPostProcessorTests: XCTestCase {
|
|
func testLocalASRAppliesDictionaryAliasesToRawAndPolishInputs() throws {
|
|
var dictionary = PersonalDictionary.empty
|
|
let entry = try XCTUnwrap(dictionary.upsertManual(term: "SwiftUI"))
|
|
dictionary.updateAliases(for: entry.id, aliases: ["swift u i"])
|
|
|
|
let result = FlowASRPostProcessor.process(
|
|
text: "请介绍 swift u i",
|
|
textForPolish: "请介绍 swift u i。",
|
|
engineMode: "local",
|
|
dictionary: dictionary
|
|
)
|
|
|
|
XCTAssertEqual(result.text, "请介绍 SwiftUI")
|
|
XCTAssertEqual(result.textForPolish, "请介绍 SwiftUI。")
|
|
}
|
|
|
|
func testCloudASRLeavesProviderBiasedTranscriptUnchanged() throws {
|
|
var dictionary = PersonalDictionary.empty
|
|
let entry = try XCTUnwrap(dictionary.upsertManual(term: "SwiftUI"))
|
|
dictionary.updateAliases(for: entry.id, aliases: ["swift u i"])
|
|
|
|
let result = FlowASRPostProcessor.process(
|
|
text: "请介绍 swift u i",
|
|
textForPolish: "请介绍 swift u i。",
|
|
engineMode: "cloud",
|
|
dictionary: dictionary
|
|
)
|
|
|
|
XCTAssertEqual(result.text, "请介绍 swift u i")
|
|
XCTAssertEqual(result.textForPolish, "请介绍 swift u i。")
|
|
}
|
|
}
|