Skip to content

Commit 77a490a

Browse files
jjuhltexus
authored andcommitted
Test a few more ways to call ToggleButton::create
1 parent 66185b8 commit 77a490a

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/Widgets/ToggleButton.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
TEST_CASE("[ToggleButton]")
2828
{
2929
const tgui::ToggleButton::Ptr button = tgui::ToggleButton::create();
30+
const tgui::ToggleButton::Ptr buttonWithText = tgui::ToggleButton::create("Button text");
31+
const tgui::ToggleButton::Ptr buttonWithTextDown = tgui::ToggleButton::create("Button text down", true);
32+
const tgui::ToggleButton::Ptr buttonWithoutTextDown = tgui::ToggleButton::create("", true);
3033
button->getRenderer()->setFont("resources/DejaVuSans.ttf");
3134

3235
SECTION("Signals")
@@ -59,6 +62,11 @@ TEST_CASE("[ToggleButton]")
5962
REQUIRE(button->getText().empty());
6063
button->setText("SomeText");
6164
REQUIRE(button->getText() == "SomeText");
65+
REQUIRE(!buttonWithText->getText().empty());
66+
REQUIRE(buttonWithText->getText() == "Button text");
67+
REQUIRE(!buttonWithTextDown->getText().empty());
68+
REQUIRE(buttonWithTextDown->getText() == "Button text down");
69+
REQUIRE(buttonWithoutTextDown->getText().empty());
6270
}
6371

6472
SECTION("Down")
@@ -72,6 +80,9 @@ TEST_CASE("[ToggleButton]")
7280
REQUIRE(!button->isDown());
7381
REQUIRE_NOTHROW(button->setDown(false));
7482
REQUIRE(!button->isDown());
83+
REQUIRE(!buttonWithText->isDown());
84+
REQUIRE(buttonWithTextDown->isDown());
85+
REQUIRE(buttonWithoutTextDown->isDown());
7586
}
7687

7788
SECTION("TextSize")

0 commit comments

Comments
 (0)