mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
The owner's decision for this PR: when two addresses are said back to back, the
second's local part the first's domain, the first is written and the second
left as said. "a at sign b.com at sign c.com" is "a@b.com at sign c.com", and
"mail john at the rate gmail dot com at the rate yahoo dot com" is "mail
john@gmail.com at the rate yahoo dot com". The Swift rules before the core
trapped there (text[cursor..<start]), and the wrapper trapped on purpose.
The fix is in the core (spoken_symbols drops an edit that starts inside the one
before), so Android gets it too. The trap path goes: SpokenCleanupRules
.overlappingAddresses(in:), HK_DICTATION_OVERLAPPING_ADDRESSES and the skipped
trap test, replaced by SpokenSymbolsBackToBackTests, a plain test of both inputs.
The ABI stays 3, which no release has used.
The fixture holds the decided cases as the core writes them, marked
"decided": "overlapping-addresses" (8 of its 4,695), recorded from the 06ac30af
oracle carrying the same fix; the shipped exporter carries the marks forward and
writes the fixture back byte for byte. In-process (-O) the decided category is
16 cases per run (8 from the test strings, 8 generated), equal to the fixed
oracle; every other operation stays at 0 differences: 2,024,458 and 2,024,447
cases on iOS 27, 2,024,458 on iOS 26.3.
24 lines
1.1 KiB
Swift
24 lines
1.1 KiB
Swift
import XCTest
|
|
@testable import HEX
|
|
|
|
/// Two addresses said back to back, the second's local part the first's domain: the first is
|
|
/// written and the second left as said (the owner's decided change; the Swift rules before the
|
|
/// keyboard core trapped on these).
|
|
final class SpokenSymbolsBackToBackTests: XCTestCase {
|
|
func testBackToBackAddressesKeepTheFirst() {
|
|
XCTAssertEqual(
|
|
SpokenCleanupRules.spokenSymbols(in: "a at sign b.com at sign c.com", language: "en-US"),
|
|
"a@b.com at sign c.com"
|
|
)
|
|
XCTAssertEqual(
|
|
SpokenCleanupRules.spokenSymbols(in: "mail john at the rate gmail dot com at the rate yahoo dot com",
|
|
language: "en-US"),
|
|
"mail john@gmail.com at the rate yahoo dot com"
|
|
)
|
|
// One address after another, apart, as before.
|
|
XCTAssertEqual(
|
|
SpokenCleanupRules.spokenSymbols(in: "john at sign gmail.com and mary at sign yahoo.com", language: "en-US"),
|
|
"john@gmail.com and mary@yahoo.com"
|
|
)
|
|
}
|
|
}
|