diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-09-25 10:53:37 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-09-27 15:50:43 +0200 |
commit | 4d74a89cfcdce4d9207f51c786a2a1fc278c5a11 (patch) | |
tree | 57dad8d63de8a0bf1b5f5e6e13d57982da431601 /tests/scripts | |
parent | be6a29a596b5da3be4c00943cd5bdceabd5159c5 (diff) | |
download | weechat-4d74a89cfcdce4d9207f51c786a2a1fc278c5a11.zip |
api: add function string_parse_size
Diffstat (limited to 'tests/scripts')
-rw-r--r-- | tests/scripts/python/testapi.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/scripts/python/testapi.py b/tests/scripts/python/testapi.py index 75a119b8d..6d3833a1a 100644 --- a/tests/scripts/python/testapi.py +++ b/tests/scripts/python/testapi.py @@ -72,6 +72,16 @@ def test_strings(): check(weechat.string_format_size(1) == '1 byte') check(weechat.string_format_size(2097152) == '2.10 MB') check(weechat.string_format_size(420000000) == '420.00 MB') + check(weechat.string_parse_size('') == 0) + check(weechat.string_parse_size('*') == 0) + check(weechat.string_parse_size('z') == 0) + check(weechat.string_parse_size('1ba') == 0) + check(weechat.string_parse_size('1') == 1) + check(weechat.string_parse_size('12b') == 12) + check(weechat.string_parse_size('123 b') == 123) + check(weechat.string_parse_size('1.34k') == 1340) + check(weechat.string_parse_size('1.5m') == 1500000) + check(weechat.string_parse_size('2.1g') == 2100000000) check(weechat.string_color_code_size('') == 0) check(weechat.string_color_code_size('test') == 0) str_color = weechat.color('yellow,red') |