From 8107b5d162a2e3f96927119e38a63a5c7e3e254f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 27 Jan 2020 21:53:18 +0100 Subject: tests: add eval tests on options with different types --- tests/unit/core/test-core-eval.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/unit/core') diff --git a/tests/unit/core/test-core-eval.cpp b/tests/unit/core/test-core-eval.cpp index e5febcd3f..4e0b34ed4 100644 --- a/tests/unit/core/test-core-eval.cpp +++ b/tests/unit/core/test-core-eval.cpp @@ -30,6 +30,7 @@ extern "C" #include "src/core/wee-config.h" #include "src/core/wee-config-file.h" #include "src/core/wee-hashtable.h" +#include "src/core/wee-secure.h" #include "src/core/wee-string.h" #include "src/core/wee-version.h" #include "src/gui/gui-color.h" @@ -485,10 +486,17 @@ TEST(CoreEval, EvalExpression) WEE_CHECK_EVAL("123129", "${calc:${repeat:2,123}+2*3}"); /* test option */ + hashtable_set (secure_hashtable_data, "sec_option", "sec_value"); + WEE_CHECK_EVAL("sec_value", "${sec.data.sec_option}"); + hashtable_remove (secure_hashtable_data, "sec_option"); snprintf (str_value, sizeof (str_value), "%d", CONFIG_INTEGER(config_look_scroll_amount)); WEE_CHECK_EVAL(str_value, "${weechat.look.scroll_amount}"); WEE_CHECK_EVAL(str_value, "${${window.buffer.name}.look.scroll_amount}"); + WEE_CHECK_EVAL("right", "${weechat.look.prefix_align}"); + WEE_CHECK_EVAL("1", "${weechat.startup.display_logo}"); + WEE_CHECK_EVAL("=!=", "${weechat.look.prefix_error}"); + WEE_CHECK_EVAL("lightcyan", "${weechat.color.chat_nick}"); /* test hdata */ WEE_CHECK_EVAL("x", "x${buffer.number"); -- cgit v1.2.3