#include #include #include TEST(StatusOr, TestStatusOr) { sled::StatusOr so; EXPECT_FALSE(so.ok()); so = sled::StatusOr(1); EXPECT_TRUE(so.ok()); EXPECT_EQ(so.value(), 1); EXPECT_EQ(so.status().code(), sled::StatusCode::kOk); } TEST(StatusOr, make_status_or) { auto from_raw_str = sled::make_status_or("hello"); auto from_string = sled::make_status_or(std::string("world")); EXPECT_TRUE(from_raw_str.ok()); EXPECT_TRUE(from_string.ok()); EXPECT_EQ(from_raw_str.value(), "hello"); EXPECT_EQ(from_string.value(), "world"); }