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.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('');
+});