File tests/misc/event_loop.c changed (mode: 100644) (index a7c3ab40d..ade3ff724) |
4 |
4 |
|
|
5 |
5 |
#include "../../src/cfg/config.h" |
#include "../../src/cfg/config.h" |
6 |
6 |
#include "../../src/engine/cmds.h" |
#include "../../src/engine/cmds.h" |
|
7 |
|
#include "../../src/engine/completion.h" |
7 |
8 |
#include "../../src/engine/keys.h" |
#include "../../src/engine/keys.h" |
8 |
9 |
#include "../../src/engine/mode.h" |
#include "../../src/engine/mode.h" |
9 |
10 |
#include "../../src/lua/vlua.h" |
#include "../../src/lua/vlua.h" |
|
... |
... |
TEST(pending_flags_are_reset) |
157 |
158 |
curr_stats.vlua = NULL; |
curr_stats.vlua = NULL; |
158 |
159 |
} |
} |
159 |
160 |
|
|
|
161 |
|
TEST(key_suggestions) |
|
162 |
|
{ |
|
163 |
|
cfg.sug.flags = SF_NORMAL | SF_KEYS; |
|
164 |
|
cfg.min_timeout_len = 1; |
|
165 |
|
|
|
166 |
|
keys_add_info_t x_key = { WK_X, { {&X_key} } }; |
|
167 |
|
vle_keys_add(&x_key, 1U, NORMAL_MODE); |
|
168 |
|
|
|
169 |
|
assert_success(vle_keys_user_add(L"Xj", L"j", NORMAL_MODE, KEYS_FLAG_NONE)); |
|
170 |
|
assert_success(vle_keys_user_add(L"Xk", L"k", NORMAL_MODE, KEYS_FLAG_NONE)); |
|
171 |
|
|
|
172 |
|
feed_keys(L"X"); |
|
173 |
|
|
|
174 |
|
quit = 0; |
|
175 |
|
event_loop(&quit, /*manage_marking=*/1); |
|
176 |
|
|
|
177 |
|
const vle_compl_t *items = vle_compl_get_items(); |
|
178 |
|
assert_int_equal(2, vle_compl_get_count()); |
|
179 |
|
assert_string_equal("key: j", items[0].text); |
|
180 |
|
assert_string_equal("j", items[0].descr); |
|
181 |
|
assert_string_equal("key: k", items[1].text); |
|
182 |
|
assert_string_equal("k", items[1].descr); |
|
183 |
|
|
|
184 |
|
cfg.sug.flags = 0; |
|
185 |
|
cfg.min_timeout_len = 0; |
|
186 |
|
} |
|
187 |
|
|
160 |
188 |
static void |
static void |
161 |
189 |
x_key(key_info_t key_info, keys_info_t *keys_info) |
x_key(key_info_t key_info, keys_info_t *keys_info) |
162 |
190 |
{ |
{ |