diff --git a/tests/translit.c b/tests/translit.c index 3f5643b..ed6aa6b 100644 --- a/tests/translit.c +++ b/tests/translit.c @@ -3,6 +3,9 @@ #include "../compat.h" #include "../transliteration.h" +#define ZWJ "\u200d" +#define ZWNJ "\u200c" + static void test_transliterate_devanagari_to_latin(const char *devanagari, const char *latin) { @@ -79,8 +82,20 @@ END_TEST START_TEST(test_translit_zero_width_joiner) { - test_transliterate_devanagari_to_latin("श‍ृ शृ", "ś\u200dṛ śṛ"); - test_transliterate_latin_to_devanagari("ś\u200dṛ śṛ", "श‍ृ शृ"); + test_transliterate_devanagari_to_latin("श‍ृ शृ", "ś"ZWJ"ṛ śṛ"); + test_transliterate_latin_to_devanagari("ś"ZWJ"ṛ śṛ", "श‍ृ शृ"); +} +END_TEST + +START_TEST(test_translit_vedic) +{ + /* rigveda 1.25.4 */ + test_transliterate_devanagari_to_latin("वस्यइष्टये", "vasya"ZWNJ"iṣṭaye"); + test_transliterate_latin_to_devanagari("vasya"ZWNJ"iṣṭaye", "वस्यइष्टये"); + + /* rigveda 3.5.2 */ + test_transliterate_devanagari_to_latin("पूर्वीर्ऋतस्य", "pūrvīr"ZWNJ"ṛtasya"); + test_transliterate_latin_to_devanagari("pūrvīr"ZWNJ"ṛtasya", "पूर्वीर्ऋतस्य"); } END_TEST @@ -91,4 +106,5 @@ void register_translit_tests(TCase *test_case) tcase_add_test(test_case, test_translit_lla_sylable); tcase_add_test(test_case, test_translit_candrabindu); tcase_add_test(test_case, test_translit_zero_width_joiner); + tcase_add_test(test_case, test_translit_vedic); }