C++ SharedString API: allow assigning from const char *

There is already a constructor that takes a char*, so there should be an
assignment operator as well
This commit is contained in:
Olivier Goffart 2021-04-27 10:37:27 +02:00
parent 0083bd8d23
commit 3ab11b62e6
2 changed files with 17 additions and 3 deletions

View file

@ -27,6 +27,12 @@ SCENARIO("SharedString API")
str = foo_view;
REQUIRE(str == "Foo");
}
SECTION("Construct from char*")
{
str = "Bar";
REQUIRE(str == "Bar");
}
}
TEST_CASE("Basic SharedVector API", "[vector]")
@ -73,4 +79,4 @@ TEST_CASE("C++ Timers")
Timer testTimer(std::chrono::milliseconds(16), []() { sixtyfps::quit_event_loop(); });
sixtyfps::run_event_loop();
}
}