summaryrefslogtreecommitdiff
path: root/src/language.test.ts
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2024-05-06 18:03:34 -0500
committersanine <sanine.not@pm.me>2024-05-06 18:03:34 -0500
commit83606cd57dbfdad8a1fa0eaef2ee127f7fc2ba2c (patch)
treeede1cc779e0c0faab0511ab802dd1b14afff4114 /src/language.test.ts
parent345b7daf4509ac89f70790c71cb2cba9b7a4f300 (diff)
add basic consonant features
Diffstat (limited to 'src/language.test.ts')
-rw-r--r--src/language.test.ts38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/language.test.ts b/src/language.test.ts
index e9845a1..d3c6f23 100644
--- a/src/language.test.ts
+++ b/src/language.test.ts
@@ -31,3 +31,41 @@ test('correctly output basic vowels', () => {
})).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('');
+});