tests: add tests on translation in evaluated expressions

This commit is contained in:
Sébastien Helleu 2021-05-16 14:09:07 +02:00
parent 58c66474ce
commit e03642e9df

View 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}");