From a686abd267998344066209695234b0c6dd426aad Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 4 Nov 2024 20:31:27 +0100 Subject: [PATCH] TestSuite: amend "widgets_inputtext_callback_misc" https://github.com/ocornut/imgui/pull/7925 --- imgui_test_suite/imgui_tests_widgets_inputtext.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/imgui_test_suite/imgui_tests_widgets_inputtext.cpp b/imgui_test_suite/imgui_tests_widgets_inputtext.cpp index 5bd7f5b..ac6a36f 100644 --- a/imgui_test_suite/imgui_tests_widgets_inputtext.cpp +++ b/imgui_test_suite/imgui_tests_widgets_inputtext.cpp @@ -1117,6 +1117,16 @@ void RegisterTests_WidgetsInputText(ImGuiTestEngine* e) IM_CHECK_STR_EQ(vars.CompletionBuffer.c_str(), "Hello World"); ctx->KeyPress(ImGuiKey_Tab); IM_CHECK_STR_EQ(vars.CompletionBuffer.c_str(), "Hello World......................................."); +#if IMGUI_VERSION_NUM >= 19143 + // Regression between 19113 and 19120 + ctx->KeyChars("!!"); + IM_CHECK_STR_EQ(vars.CompletionBuffer.c_str(), "Hello World.......................................!!"); +#endif + + ctx->KeyCharsReplace("Hello World"); + IM_CHECK_STR_EQ(vars.CompletionBuffer.c_str(), "Hello World"); + ctx->KeyPress(ImGuiKey_Tab); + IM_CHECK_STR_EQ(vars.CompletionBuffer.c_str(), "Hello World......................................."); // Test undo after callback changes ctx->KeyPress(ImGuiMod_Ctrl | ImGuiKey_Z);