diff options
author | sanine <sanine.not@pm.me> | 2024-05-06 18:44:09 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2024-05-06 18:44:09 -0500 |
commit | 3c5c5ef59088a96b7988652f2dfef3d8a771f464 (patch) | |
tree | 7ce091e0b738c094014bc5f298af173c589dfefe /src/language.test.ts | |
parent | 83606cd57dbfdad8a1fa0eaef2ee127f7fc2ba2c (diff) |
implement consonant featural selection
Diffstat (limited to 'src/language.test.ts')
-rw-r--r-- | src/language.test.ts | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/src/language.test.ts b/src/language.test.ts index d3c6f23..62b03a2 100644 --- a/src/language.test.ts +++ b/src/language.test.ts @@ -69,3 +69,73 @@ test('fail to output impossible consonants', () => { voice: false, })).toBe(''); }); + + +test('all consonants can be selected', () => { + expect(lang.pickConsonants( + [ lang.ConsonantPlace.Bilabial ], + [ lang.ConsonantManner.Nasal ], + [ true, true ], + )).toEqual([ + { + place: lang.ConsonantPlace.Bilabial, + manner: lang.ConsonantManner.Nasal, + voice: false, + }, + { + place: lang.ConsonantPlace.Bilabial, + manner: lang.ConsonantManner.Nasal, + voice: true, + }, + ]); + + expect(lang.pickConsonants( + [ lang.ConsonantPlace.Labiodental ], + [ + lang.ConsonantManner.Nasal, + lang.ConsonantManner.Plosive, + lang.ConsonantManner.SibilantAffricate, + lang.ConsonantManner.NonSibilantAffricate, + lang.ConsonantManner.SibilantFricative, + lang.ConsonantManner.NonSibilantFricative, + lang.ConsonantManner.Approximant, + lang.ConsonantManner.Tap, + lang.ConsonantManner.Trill, + lang.ConsonantManner.LateralAffricate, + lang.ConsonantManner.LateralFricative, + lang.ConsonantManner.LateralApproximant, + lang.ConsonantManner.LateralTap, + ], + [ true, false ], + )).toEqual([ + { + place: lang.ConsonantPlace.Labiodental, + manner: lang.ConsonantManner.Nasal, + voice: false, + }, + { + place: lang.ConsonantPlace.Labiodental, + manner: lang.ConsonantManner.Plosive, + voice: false, + }, + { + place: lang.ConsonantPlace.Labiodental, + manner: lang.ConsonantManner.NonSibilantAffricate, + voice: false, + }, + { + place: lang.ConsonantPlace.Labiodental, + manner: lang.ConsonantManner.NonSibilantFricative, + voice: false, + }, + ]); + + + expect(lang.pickConsonants( + [ lang.ConsonantPlace.Bilabial, lang.ConsonantPlace.Alveolar ], + [ lang.ConsonantManner.Plosive, lang.ConsonantManner.Tap ], + [ true, true ], + ).map(lang.consonantFeaturesToIpa)).toEqual([ + 'p', 'b', 'ⱱ̟', 't', 'd', 'ɾ̥', 'ɾ', + ]); +}); |