mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
C++: Add clear() method to SharedString (#8797)
A convenience method to reset to an empty string, like already known from std::string. ChangeLog: [C++] Added `SharedString::clear()`
This commit is contained in:
parent
9a1ccaf502
commit
68b46276af
2 changed files with 11 additions and 0 deletions
|
@ -53,6 +53,14 @@ SCENARIO("SharedString API")
|
|||
REQUIRE(str.size() == 5);
|
||||
}
|
||||
|
||||
SECTION("clear")
|
||||
{
|
||||
str = "Hello";
|
||||
str.clear();
|
||||
REQUIRE(str.size() == 0);
|
||||
REQUIRE(std::string_view(str.data()) == "");
|
||||
}
|
||||
|
||||
SECTION("to_lowercase")
|
||||
{
|
||||
str = "Hello";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue