Skip to content

Commit 86d6b9a

Browse files
committed
Add test for TartanLlama#145
1 parent f7f82e3 commit 86d6b9a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/issues.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,4 +201,23 @@ TEST_CASE("PR 156", "[pr.156]") {
201201
REQUIRE(!(a != b));
202202
REQUIRE(a != c);
203203
REQUIRE(b != c);
204+
}
205+
206+
class MoveOnly {
207+
public:
208+
MoveOnly() = default;
209+
210+
// Non-copyable
211+
MoveOnly(const MoveOnly &) = delete;
212+
MoveOnly &operator=(const MoveOnly &) = delete;
213+
214+
// Movable trivially
215+
MoveOnly(MoveOnly &&) = default;
216+
MoveOnly &operator=(MoveOnly &&) = default;
217+
};
218+
219+
TEST_CASE("Issue 145", "[issues.145]") {
220+
tl::expected<MoveOnly, std::error_code> a{};
221+
tl::expected<MoveOnly, std::error_code> b = std::move(a);
222+
a = std::move(b);
204223
}

0 commit comments

Comments
 (0)