Lines Matching refs:ftl
28 using IntExp = ftl::Expected<int, std::errc>;
29 using StringExp = ftl::Expected<std::string, std::errc>;
49 const auto exp = StringExp(ftl::Unexpected(std::errc::invalid_argument)); in TEST()
56 EXPECT_FALSE(IntExp(ftl::Unexpected(std::errc::io_error)).has_error([](auto) { return false; })); in TEST()
58 EXPECT_TRUE(StringExp(ftl::Unexpected(std::errc::permission_denied)).has_error([](auto e) { in TEST()
64 EXPECT_EQ(ftl::Optional(-1), IntExp(-1).value_opt()); in TEST()
65 EXPECT_EQ(std::nullopt, IntExp(ftl::Unexpected(std::errc::broken_pipe)).value_opt()); in TEST()
69 EXPECT_EQ(ftl::Optional('f'), in TEST()
75 EXPECT_EQ(ftl::Optional(6), std::move(exp).value_opt().transform(&std::string::length)); in TEST()
104 void uppercase(char& c, ftl::Optional<char> opt) { in uppercase()
105 c = std::toupper(FTL_TRY(std::move(opt).ok_or(ftl::Unit()))); in uppercase()
113 EXPECT_TRUE(increment_try(ftl::Unexpected(std::errc::value_too_large)).has_error([](std::errc e) { in TEST()
118 EXPECT_TRUE(repeat_try(ftl::Unexpected(std::errc::bad_message)).has_error([](std::errc e) { in TEST()
135 increment_expect(ftl::Unexpected(std::errc::value_too_large), i)); in TEST()
141 EXPECT_EQ(std::errc::bad_message, repeat_expect(ftl::Unexpected(std::errc::bad_message), str)); in TEST()