summaryrefslogtreecommitdiff
path: root/src/language.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/language.test.ts')
-rw-r--r--src/language.test.ts70
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', 'ɾ̥', 'ɾ',
+ ]);
+});