From d33bbbe4d6c2dc7a1d5013c42c728e5bbe531c60 Mon Sep 17 00:00:00 2001 From: itsrubberduck Date: Mon, 27 Jul 2026 00:04:11 +0200 Subject: [PATCH] test(tts): pin that bare waypoints are spoken as words The backend now fuzzy-matches waypoints that STT mangled, which only holds if the controller says them as words in the first place. That behaviour was already correct but untested, so a future change to the waypoint rule could have silently started spelling BIBAX out letter by letter. --- tests/shared/radioSpeech.test.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/shared/radioSpeech.test.ts b/tests/shared/radioSpeech.test.ts index f33d659..73c2127 100644 --- a/tests/shared/radioSpeech.test.ts +++ b/tests/shared/radioSpeech.test.ts @@ -35,6 +35,21 @@ describe('normalizeRadioPhrase — PM radio pronunciation', () => { it('leaves sub-1000 numbers (speeds/headings) untouched', () => { assert.equal(normalizeRadioPhrase('maintain 250 knots', opts), 'maintain 250 knots') }) + + // ICAO five-letter name-codes are built to be pronounceable and are spoken as + // words on the radio. Spelling them out would both be wrong phraseology and + // train the pilot to read back a spelling the matcher then has to undo. + it('speaks a bare waypoint as a word, not letter by letter', () => { + for (const [written, spoken] of [ + ['BIBAX', 'Bibax'], + ['SULUS', 'Sulus'], + ['ANEKI', 'Aneki'], + ]) { + const out = normalizeRadioPhrase(`direct ${written}`, opts) + assert.equal(out, `direct ${spoken}`) + assert.doesNotMatch(out, /Bravo|Sierra|Alfa/) + } + }) }) describe('speakToken', () => {