diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-12-17 15:37:48 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-12-18 14:13:14 +0100 |
commit | 3ef8241444540c9c42e430588712d4316fbc9a8f (patch) | |
tree | 90add112ecaabfb5b4676f64d00b45bd053764a2 /tests | |
parent | dd9ae79204b815187472f5c5ab03495435affa7c (diff) | |
download | weechat-3ef8241444540c9c42e430588712d4316fbc9a8f.zip |
tests: add tests on gui input completion functions
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/gui/test-gui-input.cpp | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/tests/unit/gui/test-gui-input.cpp b/tests/unit/gui/test-gui-input.cpp index 8bc444a01..1ba5d2c69 100644 --- a/tests/unit/gui/test-gui-input.cpp +++ b/tests/unit/gui/test-gui-input.cpp @@ -191,31 +191,33 @@ TEST(GuiInput, Return) /* * Tests functions: * gui_input_complete - */ - -TEST(GuiInput, Complete) -{ - /* TODO: write tests */ -} - -/* - * Tests functions: * gui_input_complete_next + * gui_input_complete_previous */ TEST(GuiInput, CompleteNext) { - /* TODO: write tests */ -} - -/* - * Tests functions: - * gui_input_complete_previous - */ + gui_input_replace_input (gui_buffers, ""); + LONGS_EQUAL(0, gui_buffers->input_buffer_pos); + STRCMP_EQUAL("", gui_buffers->input_buffer); -TEST(GuiInput, CompletePrevious) -{ - /* TODO: write tests */ + gui_input_insert_string (gui_buffers, "/wa"); + + gui_input_complete_next (gui_buffers); + STRCMP_EQUAL("/wait ", gui_buffers->input_buffer); + gui_input_complete_next (gui_buffers); + STRCMP_EQUAL("/wallchops ", gui_buffers->input_buffer); + gui_input_complete_next (gui_buffers); + STRCMP_EQUAL("/wallops ", gui_buffers->input_buffer); + gui_input_complete_next (gui_buffers); + STRCMP_EQUAL("/wait ", gui_buffers->input_buffer); + + gui_input_complete_previous (gui_buffers); + STRCMP_EQUAL("/wallops ", gui_buffers->input_buffer); + gui_input_complete_previous (gui_buffers); + STRCMP_EQUAL("/wallchops ", gui_buffers->input_buffer); + gui_input_complete_previous (gui_buffers); + STRCMP_EQUAL("/wait ", gui_buffers->input_buffer); } /* |