verify that my plan for making the German infinitive an optional alias will work.

This commit is contained in:
Enno Rehling 2014-10-23 16:37:00 +02:00
parent f788f19f6c
commit 0a1209d031
1 changed files with 8 additions and 0 deletions

View File

@ -1,6 +1,7 @@
#include <platform.h>
#include "kernel/types.h"
#include "kernel/config.h"
#include "kernel/order.h"
#include "keyword.h"
#include "util/language.h"
#include "tests.h"
@ -20,14 +21,21 @@ static void test_init_keywords(CuTest *tc) {
}
static void test_infinitive(CuTest *tc) {
char buffer[32];
struct locale *lang;
struct order *ord;
test_cleanup();
lang = get_or_create_locale("de");
locale_setstring(lang, "keyword::study", "LERNE");
init_keyword(lang, K_STUDY, "LERNE");
init_keyword(lang, K_STUDY, "LERNEN");
CuAssertIntEquals(tc, K_STUDY, get_keyword("LERN", lang));
CuAssertIntEquals(tc, K_STUDY, get_keyword("LERNE", lang));
CuAssertIntEquals(tc, K_STUDY, get_keyword("LERNEN", lang));
ord = create_order(K_STUDY, lang, "");
CuAssertStrEquals(tc, "LERNE", get_command(ord, buffer, sizeof(buffer)));
test_cleanup();
}