Skip to content

Commit 22fc9b8

Browse files
committed
TestSuite: amend "nav_menu_alt_key"
1 parent 8412ecb commit 22fc9b8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

imgui_test_suite/imgui_tests_nav.cpp

+13-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ void RegisterTests_Nav(ImGuiTestEngine* e)
206206

207207
// ## Test that Alt toggle layer, test that AltGr doesn't.
208208
// ## Test that toggling layer steals active id.
209-
// ## Test that toggling layer is canceled by character typing (#370)
209+
// ## Test that toggling layer is canceled by character typing or any other key (#370)
210210
// ## Test that ESC closes a menu
211211
// All those are performed on child and popups windows as well.
212212
t = IM_REGISTER_TEST(e, "nav", "nav_menu_alt_key");
@@ -337,6 +337,18 @@ void RegisterTests_Nav(ImGuiTestEngine* e)
337337
ctx->KeyUp(ImGuiMod_Alt);
338338
IM_CHECK(g.NavLayer == ImGuiNavLayer_Main);
339339
IM_CHECK_EQ(g.ActiveId, input_id);
340+
ctx->KeyPress(ImGuiKey_Escape);
341+
342+
#if IMGUI_VERSION_NUM >= 19111
343+
// Test that toggling layer is canceled by character typing (#370)
344+
IM_CHECK_EQ(g.ActiveId, 0u);
345+
ctx->KeyDown(ImGuiMod_Alt);
346+
ctx->KeyPress(ImGuiKey_Apostrophe);
347+
ctx->KeyUp(ImGuiMod_Alt);
348+
IM_CHECK(g.NavLayer == ImGuiNavLayer_Main);
349+
IM_CHECK_EQ(g.ActiveId, 0u);
350+
#endif
351+
340352
#endif
341353
}
342354
};

0 commit comments

Comments
 (0)