cpp: added to_lowercase and to_uppercase to SharedString (#6869)

* cpp: added to_lowercase and to_uppercase to SharedString

* Update api/cpp/include/slint_string.h

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update api/cpp/include/slint_string.h

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update api/cpp/include/slint_string.h

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update api/cpp/include/slint_string.h

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update internal/core/string.rs

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update internal/core/string.rs

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update internal/core/string.rs

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update internal/core/string.rs

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* code review feedback

* Update api/cpp/tests/datastructures.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* code review feedback

* Update api/cpp/include/slint_string.h

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>

* Update api/cpp/include/slint_string.h

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
This commit is contained in:
FloVanGH 2024-11-21 18:53:02 +00:00 committed by GitHub
parent 5f08e09810
commit 6ebce7e5f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 75 additions and 0 deletions

View file

@ -52,6 +52,17 @@ SCENARIO("SharedString API")
str = "Hello";
REQUIRE(str.size() == 5);
}
SECTION("to_lowercase")
{
str = "Hello";
REQUIRE(std::string_view(str.to_lowercase().data()) == "hello");
}
SECTION("to_uppercase")
{
str = "Hello";
REQUIRE(std::string_view(str.to_uppercase().data()) == "HELLO");
}
}
TEST_CASE("Basic SharedVector API", "[vector]")