1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 06:46:38 +02:00

tests: add tests on functions gui_buffer_new and gui_buffer_new_props

This commit is contained in:
Sébastien Helleu
2022-03-13 12:22:36 +01:00
parent e5e3a9d2da
commit 4629b17173
9 changed files with 1303 additions and 5 deletions
+1
View File
@@ -422,6 +422,7 @@ WeeChat "core" is located in following directories:
|          test-core-utf8.cpp | Tests: UTF-8.
|          test-core-util.cpp | Tests: utility functions.
|       gui/ | Root of unit tests for interfaces.
|          test-gui-buffer.cpp | Tests: buffer functions.
|          test-gui-chat.cpp | Tests: chat functions.
|          test-gui-color.cpp | Tests: colors.
|          test-gui-line.cpp | Tests: lines.
+1
View File
@@ -424,6 +424,7 @@ Le cœur de WeeChat est situé dans les répertoires suivants :
|          test-core-utf8.cpp | Tests : UTF-8.
|          test-core-util.cpp | Tests : fonctions utiles.
|       gui/ | Racine des tests unitaires pour les interfaces.
|          test-gui-buffer.cpp | Tests : tampons.
|          test-gui-chat.cpp | Tests : fonctions de discussion.
|          test-gui-color.cpp | Tests : couleurs.
|          test-gui-line.cpp | Tests : lignes.
+2
View File
@@ -450,6 +450,8 @@ WeeChat "core" は以下のディレクトリに配置されています:
|          test-core-util.cpp | テスト: ユーティリティ関数
|       gui/ | インターフェースの単体テストを収める最上位ディレクトリ
// TRANSLATION MISSING
|          test-gui-buffer.cpp | Tests: buffer functions.
// TRANSLATION MISSING
|          test-gui-chat.cpp | Tests: chat functions.
// TRANSLATION MISSING
|          test-gui-color.cpp | Tests: colors.
+2
View File
@@ -424,6 +424,8 @@ WeeChat „језгро” се налази у следећим директо
|          test-core-utf8.cpp | Тестови: UTF-8.
|          test-core-util.cpp | Тестови: помоћне функције.
|       gui/ | Корен unit тестова интерфејса.
// TRANSLATION MISSING
|          test-gui-buffer.cpp | Tests: buffer functions.
|          test-gui-chat.cpp | Тестови: чет функције.
|          test-gui-color.cpp | Тестови: боје.
|          test-gui-line.cpp | Тестови: линије.
+1
View File
@@ -42,6 +42,7 @@ set(LIB_WEECHAT_UNIT_TESTS_CORE_SRC
unit/core/test-core-url.cpp
unit/core/test-core-utf8.cpp
unit/core/test-core-util.cpp
unit/gui/test-gui-buffer.cpp
unit/gui/test-gui-chat.cpp
unit/gui/test-gui-color.cpp
unit/gui/test-gui-line.cpp
+1
View File
@@ -39,6 +39,7 @@ lib_weechat_unit_tests_core_a_SOURCES = unit/core/test-core-arraylist.cpp \
unit/core/test-core-url.cpp \
unit/core/test-core-utf8.cpp \
unit/core/test-core-util.cpp \
unit/gui/test-gui-buffer.cpp \
unit/gui/test-gui-chat.cpp \
unit/gui/test-gui-color.cpp \
unit/gui/test-gui-line.cpp \
+13 -5
View File
@@ -168,11 +168,19 @@ def test_display():
check(weechat.prefix('unknown') == '')
check(weechat.color('green') != '')
check(weechat.color('unknown') == '')
weechat.prnt('', '## test prnt')
weechat.prnt_date_tags('', 946681200, 'tag1,tag2', '## test prnt_date_tags')
buffer = weechat.buffer_new('test_free', 'buffer_input_cb', '', 'buffer_close_cb', '')
weechat.prnt_y(buffer, 0, '## test prnt_y')
weechat.prnt_y_date_tags(buffer, 0, 946681200, 'tag1,tag2', '## test prnt_y_date_tags')
weechat.prnt('', '## test print core buffer')
weechat.prnt_date_tags('', 946681200, 'tag1,tag2', '## test print_date_tags core buffer')
buffer = weechat.buffer_new('test_formatted', 'buffer_input_cb', '', 'buffer_close_cb', '')
check(buffer != '')
check(weechat.buffer_get_integer(buffer, 'type') == 0)
weechat.prnt(buffer, '## test print formatted buffer')
weechat.prnt_date_tags(buffer, 946681200, 'tag1,tag2', '## test print_date_tags formatted buffer')
weechat.buffer_close(buffer)
buffer = weechat.buffer_new_props('test_free', {'type': 'free'}, 'buffer_input_cb', '', 'buffer_close_cb', '')
check(weechat.buffer_get_integer(buffer, 'type') == 1)
check(buffer != '')
weechat.prnt_y(buffer, 0, '## test print_y free buffer')
weechat.prnt_y_date_tags(buffer, 0, 946681200, 'tag1,tag2', '## test print_y_date_tags free buffer')
weechat.buffer_close(buffer)
+1
View File
@@ -79,6 +79,7 @@ IMPORT_TEST_GROUP(CoreUrl);
IMPORT_TEST_GROUP(CoreUtf8);
IMPORT_TEST_GROUP(CoreUtil);
/* GUI */
IMPORT_TEST_GROUP(GuiBuffer);
IMPORT_TEST_GROUP(GuiChat);
IMPORT_TEST_GROUP(GuiColor);
IMPORT_TEST_GROUP(GuiLine);
File diff suppressed because it is too large Load Diff