feat(keyboard): improve typing, voice flow, and polish reliability
Reduce extension memory pressure and delivery races while adding richer candidates, tactile feedback, and safer two-level creative polishing.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
// KeyboardTranslationConfigProtectionTests.swift
|
||||
// OSGKeyboardTests
|
||||
|
||||
import XCTest
|
||||
@testable import OSGKeyboardShared
|
||||
|
||||
final class KeyboardTranslationConfigProtectionTests: XCTestCase {
|
||||
|
||||
func testGraceWindowProtectsUntilDeadline() {
|
||||
let now = Date(timeIntervalSince1970: 1_700_000_000)
|
||||
let deadline = KeyboardTranslationConfigProtection.protectionDeadline(now: now)
|
||||
XCTAssertEqual(
|
||||
deadline.timeIntervalSince(now),
|
||||
KeyboardTranslationConfigProtection.chipWriteGraceSeconds,
|
||||
accuracy: 0.001
|
||||
)
|
||||
XCTAssertTrue(
|
||||
KeyboardTranslationConfigProtection.shouldProtect(until: deadline, now: now)
|
||||
)
|
||||
XCTAssertTrue(
|
||||
KeyboardTranslationConfigProtection.shouldProtect(
|
||||
until: deadline,
|
||||
now: now.addingTimeInterval(2.4)
|
||||
)
|
||||
)
|
||||
XCTAssertFalse(
|
||||
KeyboardTranslationConfigProtection.shouldProtect(
|
||||
until: deadline,
|
||||
now: deadline
|
||||
)
|
||||
)
|
||||
XCTAssertFalse(
|
||||
KeyboardTranslationConfigProtection.shouldProtect(until: nil, now: now)
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user