summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2020-01-27 23:02:30 +0100
committerSébastien Helleu <flashcode@flashtux.org>2020-01-27 23:04:24 +0100
commitd2dda92dafcf346d1a158f308e7f8fbfcc313281 (patch)
treeb34573d68814e6a43b78855dbff4c93336d47246
parenttests: add eval tests on conditions with text after closing parenthesis (diff)
downloadweechat-d2dda92dafcf346d1a158f308e7f8fbfcc313281.tar.xz
weechat-d2dda92dafcf346d1a158f308e7f8fbfcc313281.zip
tests: add eval tests with hdata variables of different types
-rw-r--r--tests/unit/core/test-core-eval.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/unit/core/test-core-eval.cpp b/tests/unit/core/test-core-eval.cpp
index f1cb40c6b..102c6382e 100644
--- a/tests/unit/core/test-core-eval.cpp
+++ b/tests/unit/core/test-core-eval.cpp
@@ -34,6 +34,7 @@ extern "C"
#include "src/core/wee-string.h"
#include "src/core/wee-version.h"
#include "src/gui/gui-buffer.h"
+#include "src/gui/gui-line.h"
#include "src/gui/gui-color.h"
#include "src/plugins/plugin.h"
}
@@ -526,6 +527,20 @@ TEST(CoreEval, EvalExpression)
snprintf (str_value, sizeof (str_value),
"${buffer[0x%lx].full_name}", (long unsigned int)gui_buffers);
WEE_CHECK_EVAL("core.weechat", str_value);
+ snprintf (str_value, sizeof (str_value), "%c", 1);
+ WEE_CHECK_EVAL(str_value,
+ "${window.buffer.own_lines.first_line.data.displayed}");
+ WEE_CHECK_EVAL("1", "${window.buffer.num_displayed}");
+ snprintf (str_value, sizeof (str_value),
+ "%lld",
+ (long long)(gui_buffers->own_lines->first_line->data->date));
+ WEE_CHECK_EVAL(str_value,
+ "${window.buffer.own_lines.first_line.data.date}");
+ snprintf (str_value, sizeof (str_value),
+ "0x%lx", (long unsigned int)(gui_buffers->local_variables));
+ WEE_CHECK_EVAL(str_value, "${window.buffer.local_variables}");
+ WEE_CHECK_EVAL("core", "${window.buffer.local_variables.plugin}");
+ WEE_CHECK_EVAL("weechat", "${window.buffer.local_variables.name}");
/* test with another prefix/suffix */
options = hashtable_new (32,