Skip to content

Commit

Permalink
Restore some strings for non-constexpr context
Browse files Browse the repository at this point in the history
  • Loading branch information
vt4a2h committed Nov 11, 2024
1 parent efce8a0 commit 92b504a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/test_expected_create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ constexpr fl::Expected<int, double> createExpectedByMove()
TEST_CASE("Expected create")
{
SECTION("Default constructable") {
const fl::Expected<int, std::string_view> expectedBox;
const fl::Expected<int, std::string> expectedBox;

REQUIRE(expectedBox.hasValue());
}

SECTION("Default constructable with correct value") {
const fl::Expected<test::details::Default, std::string_view> expectedBox;
const fl::Expected<test::details::Default, std::string> expectedBox;

REQUIRE(expectedBox.value().data == test::details::default_value);
}
Expand All @@ -58,15 +58,15 @@ TEST_CASE("Expected create")

SECTION("From unexpected")
{
const fl::Expected<int, std::string_view> expectedBox(fl::Unexpected{std::string{"123"}});
const fl::Expected<int, std::string> expectedBox(fl::Unexpected{std::string{"123"}});

REQUIRE(expectedBox.hasError());
}

SECTION("From unexpected with correct value")
{
const std::string_view unexpectedValue{"42"};
const fl::Expected<int, std::string_view> expectedBox(fl::Unexpected{unexpectedValue});
const std::string unexpectedValue{"42"};
const fl::Expected<int, std::string> expectedBox(fl::Unexpected{unexpectedValue});

REQUIRE(expectedBox.error() == unexpectedValue);
}
Expand Down

0 comments on commit 92b504a

Please sign in to comment.