Skip to content

Commit

Permalink
TestSuite: amend "misc_text_funcs" for string_view branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed May 14, 2024
1 parent e7bfb56 commit 27cb26a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions imgui_test_suite/imgui_tests_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4617,11 +4617,19 @@ void RegisterTests_Misc(ImGuiTestEngine* e)
t = IM_REGISTER_TEST(e, "misc", "misc_text_funcs");
t->TestFunc = [](ImGuiTestContext* ctx)
{
#ifdef IMGUI_HAS_IMSTR
IM_CHECK_EQ(ImTextCountLines("Hello"), 1);
IM_CHECK_EQ(ImTextCountLines("Hello\n"), 1);
IM_CHECK_EQ(ImTextCountLines("Hello\nWorld"), 2);
IM_CHECK_EQ(ImTextCountLines("Hello\nWorld\n"), 2);
IM_CHECK_EQ(ImTextCountLines("Hello\nWorld\nA"), 3);
#else
IM_CHECK_EQ(ImTextCountLines("Hello", NULL), 1);
IM_CHECK_EQ(ImTextCountLines("Hello\n", NULL), 1);
IM_CHECK_EQ(ImTextCountLines("Hello\nWorld", NULL), 2);
IM_CHECK_EQ(ImTextCountLines("Hello\nWorld\n", NULL), 2);
IM_CHECK_EQ(ImTextCountLines("Hello\nWorld\nA", NULL), 3);
#endif
};
#endif

Expand Down

0 comments on commit 27cb26a

Please sign in to comment.