]> jfr.im git - irc/weechat/weechat.git/commitdiff
tests: add tests on translation in evaluated expressions
authorSébastien Helleu <redacted>
Sun, 16 May 2021 12:09:07 +0000 (14:09 +0200)
committerSébastien Helleu <redacted>
Sun, 16 May 2021 12:09:07 +0000 (14:09 +0200)
tests/unit/core/test-core-eval.cpp

index eca88db817ce18c2f7712cca66becb7026ea16d1..1c2ae858a1cf73ae01f44baf02616c1bfe97e6b2 100644 (file)
@@ -751,6 +751,13 @@ TEST(CoreEval, EvalExpression)
     WEE_CHECK_EVAL("18", "${calc:(5+1)*3}");
     WEE_CHECK_EVAL("123129", "${calc:${repeat:2,123}+2*3}");
 
+    /* test translation */
+    setlocale (LC_ALL, "fr_FR.UTF-8");
+    WEE_CHECK_EVAL("", "${translate:}");
+    WEE_CHECK_EVAL("abcdef", "${translate:abcdef}");
+    WEE_CHECK_EVAL("Extension", "${translate:Plugin}");
+    setlocale (LC_ALL, "");
+
     /* test option */
     hashtable_set (secure_hashtable_data, "sec_option", "sec_value");
     WEE_CHECK_EVAL("sec_value", "${sec.data.sec_option}");