summaryrefslogtreecommitdiff
path: root/tests/scripts/python/testapi.py
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-08-01 21:03:44 +0200
committerSébastien Helleu <flashcode@flashtux.org>2022-08-01 21:03:44 +0200
commitb1404b02777c58d5e104082f349dff201bd12ef8 (patch)
tree6b132f6dc587e49ae31bc9a5d773c8505cdef1af /tests/scripts/python/testapi.py
parent1514570ff02967b40ad3f72e301a574ed49d29ab (diff)
downloadweechat-b1404b02777c58d5e104082f349dff201bd12ef8.zip
scripts: fix issue with year ≥ 2038 in functions print_date_tags and print_y_date_tags
Affected plugins: python, lua, tcl, guile, javascript.
Diffstat (limited to 'tests/scripts/python/testapi.py')
-rw-r--r--tests/scripts/python/testapi.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/scripts/python/testapi.py b/tests/scripts/python/testapi.py
index a9aaffee7..c4630981e 100644
--- a/tests/scripts/python/testapi.py
+++ b/tests/scripts/python/testapi.py
@@ -170,6 +170,16 @@ def test_display():
check(weechat.color('unknown') == '')
weechat.prnt('', '## test print core buffer')
weechat.prnt_date_tags('', 946681200, 'tag1,tag2', '## test print_date_tags core buffer')
+ weechat.prnt_date_tags('', 5680744830, 'tag1,tag2', '## test print_date_tags core buffer, year 2150')
+ hdata_buffer = weechat.hdata_get('buffer')
+ hdata_lines = weechat.hdata_get('lines')
+ hdata_line = weechat.hdata_get('line')
+ hdata_line_data = weechat.hdata_get('line_data')
+ buffer = weechat.buffer_search_main()
+ own_lines = weechat.hdata_pointer(hdata_buffer, buffer, 'own_lines')
+ line = weechat.hdata_pointer(hdata_lines, own_lines, 'last_line')
+ data = weechat.hdata_pointer(hdata_line, line, 'data')
+ check(weechat.hdata_time(hdata_line_data, data, 'date') == 5680744830)
buffer = weechat.buffer_new('test_formatted', 'buffer_input_cb', '', 'buffer_close_cb', '')
check(buffer != '')
check(weechat.buffer_get_integer(buffer, 'type') == 0)
@@ -181,6 +191,7 @@ def test_display():
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.prnt_y_date_tags(buffer, 1, 5680744830, 'tag1,tag2', '## test print_y_date_tags free buffer, year 2150')
weechat.buffer_close(buffer)