sanskrit-iast/tests/czech.c

41 lines
1 KiB
C
Raw Normal View History

#include "test.h"
2021-12-21 21:55:16 +01:00
#include "czech.h"
#include "../compat.h"
2021-12-21 21:55:16 +01:00
#include "../czech.h"
2020-01-07 13:18:54 +01:00
static void test_transcript(const char *devanagari, const char *latin)
{
char *czech;
int ret;
ret = transcript_devanagari_to_czech(devanagari, &czech);
ck_assert_int_eq(0, ret);
2020-01-07 13:18:54 +01:00
ck_assert_str_eq(latin, czech);
free(czech);
2020-01-07 13:18:54 +01:00
}
2020-01-07 13:18:54 +01:00
START_TEST(test_transcript_devanagari_to_czech)
{
test_transcript("तन्त्रशास्त्रम्", "tantrašástra");
2020-01-07 13:18:54 +01:00
test_transcript("सांख्य", "sánkhja");
2020-01-07 13:18:54 +01:00
test_transcript("महाभारतम्", "mahábhárata");
2020-01-07 13:18:54 +01:00
test_transcript("योगः", "jóga");
test_transcript("भगवद्गीता", "bhagavadgíta");
2020-10-11 08:55:24 +02:00
test_transcript("अग्निमीळे", "agnimílé");
2020-10-11 09:48:55 +02:00
test_transcript("तान्यजत्राँ", "tánjadžatrám");
test_transcript("श‍ृ शृ", "šr šr"); /* the zero width joiner */
}
END_TEST
2021-12-21 21:55:16 +01:00
void register_transcript_czech_tests(TCase *test_case)
{
tcase_add_test(test_case, test_transcript_devanagari_to_czech);
}