1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 00:03:12 +02:00

core: remove unused argument "pos" from function gui_input_insert_string, add tests on function

This commit is contained in:
Sébastien Helleu
2022-12-17 15:20:23 +01:00
parent f03384d124
commit dd9ae79204
10 changed files with 47 additions and 28 deletions
+30 -1
View File
@@ -116,7 +116,36 @@ TEST(GuiInput, SearchSignal)
TEST(GuiInput, InsertString)
{
/* TODO: write tests */
gui_input_replace_input (gui_buffers, "");
LONGS_EQUAL(0, gui_buffers->input_buffer_pos);
STRCMP_EQUAL("", gui_buffers->input_buffer);
gui_input_insert_string (gui_buffers, NULL);
LONGS_EQUAL(0, gui_buffers->input_buffer_pos);
STRCMP_EQUAL("", gui_buffers->input_buffer);
gui_input_insert_string (gui_buffers, "");
STRCMP_EQUAL("", gui_buffers->input_buffer);
LONGS_EQUAL(0, gui_buffers->input_buffer_size);
LONGS_EQUAL(0, gui_buffers->input_buffer_length);
LONGS_EQUAL(0, gui_buffers->input_buffer_pos);
gui_input_insert_string (gui_buffers, "noël");
STRCMP_EQUAL("noël", gui_buffers->input_buffer);
LONGS_EQUAL(5, gui_buffers->input_buffer_size);
LONGS_EQUAL(4, gui_buffers->input_buffer_length);
LONGS_EQUAL(4, gui_buffers->input_buffer_pos);
gui_input_set_pos (gui_buffers, 3);
LONGS_EQUAL(5, gui_buffers->input_buffer_size);
LONGS_EQUAL(4, gui_buffers->input_buffer_length);
LONGS_EQUAL(3, gui_buffers->input_buffer_pos);
gui_input_insert_string (gui_buffers, "ï");
STRCMP_EQUAL("noëïl", gui_buffers->input_buffer);
LONGS_EQUAL(7, gui_buffers->input_buffer_size);
LONGS_EQUAL(5, gui_buffers->input_buffer_length);
LONGS_EQUAL(4, gui_buffers->input_buffer_pos);
}
/*