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.
This commit is contained in:
itsrubberduck
2026-07-27 00:04:11 +02:00
parent 034ddbab2e
commit df5ba2a102

View File

@@ -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', () => {