diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-01-30 11:41:06 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-01-30 11:41:06 +0100 |
commit | 9259442dbfbb51695a7f9c427da589fc1f92420d (patch) | |
tree | a66f959ccf1bce41481dca238b24406fba52d4da /tests/scripts | |
parent | bf3241208b553babdeb851d684060b81d30edc72 (diff) | |
download | weechat-9259442dbfbb51695a7f9c427da589fc1f92420d.zip |
core: add support of date and tags in messages displayed in buffers with free content, add function printf_y_date_tags (closes #1746)
Diffstat (limited to 'tests/scripts')
-rw-r--r-- | tests/scripts/python/testapi.py | 16 | ||||
-rwxr-xr-x | tests/scripts/python/testapigen.py | 1 | ||||
-rw-r--r-- | tests/scripts/test-scripts.cpp | 5 |
3 files changed, 21 insertions, 1 deletions
diff --git a/tests/scripts/python/testapi.py b/tests/scripts/python/testapi.py index 634370c22..4be516319 100644 --- a/tests/scripts/python/testapi.py +++ b/tests/scripts/python/testapi.py @@ -148,6 +148,16 @@ def test_key(): check(weechat.key_unbind('mouse', 'quiet:area:chat(plugin.test)') == 3) +def buffer_input_cb(data, buffer, input_data): + """Buffer input callback.""" + return weechat.WEECHAT_RC_OK + + +def buffer_close_cb(data, buffer): + """Buffer close callback.""" + return weechat.WEECHAT_RC_OK + + def test_display(): """Test display functions.""" check(weechat.prefix('action') != '') @@ -158,6 +168,12 @@ 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.buffer_close(buffer) def completion_cb(data, completion_item, buf, completion): diff --git a/tests/scripts/python/testapigen.py b/tests/scripts/python/testapigen.py index 4a63c8f1f..3d529ea4c 100755 --- a/tests/scripts/python/testapigen.py +++ b/tests/scripts/python/testapigen.py @@ -111,6 +111,7 @@ class WeechatScript(object): # pylint: disable=too-many-instance-attributes 'prnt': 'print', 'prnt_date_tags': 'print_date_tags', 'prnt_y': 'print_y', + 'prnt_y_date_tags': 'print_y_date_tags', } for node in ast.walk(self.tree): if isinstance(node, ast.Call) and \ diff --git a/tests/scripts/test-scripts.cpp b/tests/scripts/test-scripts.cpp index 33eaa3818..1dfc38f71 100644 --- a/tests/scripts/test-scripts.cpp +++ b/tests/scripts/test-scripts.cpp @@ -89,8 +89,11 @@ TEST_GROUP(Scripts) api_tests_errors++; else if (strstr (message, "TESTS END")) api_tests_end++; - else if ((message[0] != '>') && (message[0] != ' ')) + else if ((message[0] != '>') && (message[0] != ' ') + && (strncmp (message, "## ", 3) != 0)) + { api_tests_other++; + } } return WEECHAT_RC_OK; |