Verify that a Result object can be constructed from a move-only type.
| 403 | |
| 404 | // Verify that a Result object can be constructed from a move-only type. |
| 405 | TEST(ResultTest, InitializationMoveOnlyType) { |
| 406 | std::unique_ptr<std::string> value(new std::string(kStringElement)); |
| 407 | auto str = value.get(); |
| 408 | Result<std::unique_ptr<std::string>> result(std::move(value)); |
| 409 | |
| 410 | ASSERT_TRUE(result.ok()); |
| 411 | EXPECT_EQ(result.ValueOrDie().get(), str); |
| 412 | } |
| 413 | |
| 414 | // Verify that a Result object can be move-constructed from a move-only type. |
| 415 | TEST(ResultTest, MoveConstructorMoveOnlyType) { |
nothing calls this directly
no test coverage detected