import * as lang from './language'; test('correctly output basic vowels', () => { expect(lang.vowelFeaturesToIpa({ height: lang.VowelHeight.Close, depth: lang.VowelDepth.Front, round: false, long: false, nasal: false, })).toBe('i'); expect(lang.vowelFeaturesToIpa({ height: lang.VowelHeight.Mid, depth: lang.VowelDepth.Central, round: false, long: false, nasal: false, })).toBe('ə'); expect(lang.vowelFeaturesToIpa({ height: lang.VowelHeight.Open, depth: lang.VowelDepth.Back, round: true, long: false, nasal: true, })).toBe('ɒ̃'); expect(lang.vowelFeaturesToIpa({ height: lang.VowelHeight.CloseMid, depth: lang.VowelDepth.Front, round: false, long: true, nasal: false, })).toBe('eː'); }); test('correctly output basic consonants', () => { expect(lang.consonantFeaturesToIpa({ place: lang.ConsonantPlace.Bilabial, manner: lang.ConsonantManner.Nasal, voice: true, })).toBe('m'); expect(lang.consonantFeaturesToIpa({ place: lang.ConsonantPlace.Uvular, manner: lang.ConsonantManner.NonSibilantFricative, voice: true, })).toBe('ʁ'); expect(lang.consonantFeaturesToIpa({ place: lang.ConsonantPlace.Velar, manner: lang.ConsonantManner.Plosive, voice: false, })).toBe('k'); }); test('fail to output impossible consonants', () => { expect(lang.consonantFeaturesToIpa({ place: lang.ConsonantPlace.Retroflex, manner: lang.ConsonantManner.NonSibilantAffricate, voice: false, })).toBe(''); expect(lang.consonantFeaturesToIpa({ place: lang.ConsonantPlace.Labiodental, manner: lang.ConsonantManner.Trill, voice: true, })).toBe(''); expect(lang.consonantFeaturesToIpa({ place: lang.ConsonantPlace.Palatal, manner: lang.ConsonantManner.Approximant, voice: false, })).toBe(''); });