1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 23:05:43 +02:00

scripts: add functions config_enum and config_enum_default in scripting API (issue #1973)

This commit is contained in:
Sébastien Helleu
2023-09-09 08:54:33 +02:00
parent 9fada89f96
commit d9555cc567
14 changed files with 280 additions and 2 deletions
+4
View File
@@ -327,16 +327,20 @@ def test_config():
'option_delete_cb', '',
)
check(ptr_opt_enum != '')
check(weechat.config_enum(ptr_opt_enum) == 1)
check(weechat.config_integer(ptr_opt_enum) == 1)
check(weechat.config_string(ptr_opt_enum) == 'val2')
check(weechat.config_option_set(ptr_opt_enum, 'val1', 1) == 2) # SET_OK_CHANGED
check(weechat.config_option_set(ptr_opt_enum, 'val1', 1) == 1) # SET_OK_SAME_VALUE
check(weechat.config_enum(ptr_opt_enum) == 0)
check(weechat.config_integer(ptr_opt_enum) == 0)
check(weechat.config_string(ptr_opt_enum) == 'val1')
check(weechat.config_enum_default(ptr_opt_enum) == 1)
check(weechat.config_integer_default(ptr_opt_enum) == 1)
check(weechat.config_string_default(ptr_opt_enum) == 'val2')
check(weechat.config_option_reset(ptr_opt_enum, 1) == 2) # SET_OK_CHANGED
check(weechat.config_option_reset(ptr_opt_enum, 1) == 1) # SET_OK_SAME_VALUE
check(weechat.config_enum(ptr_opt_enum) == 1)
check(weechat.config_integer(ptr_opt_enum) == 1)
check(weechat.config_string(ptr_opt_enum) == 'val2')
# search option