From 0a1209d0319fb80388e1047226e37a22891e1568 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 23 Oct 2014 16:37:00 +0200 Subject: [PATCH] verify that my plan for making the German infinitive an optional alias will work. --- src/keyword.test.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/keyword.test.c b/src/keyword.test.c index 46e8fbfdd..3f6828c76 100644 --- a/src/keyword.test.c +++ b/src/keyword.test.c @@ -1,6 +1,7 @@ #include #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(); }