mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 05:16:10 +01:00
Add test for comparing immovable types
This commit is contained in:
parent
fa31d58934
commit
65c9a1d31a
@ -259,3 +259,21 @@ TEST_CASE("Assertion macros support bit operators and bool conversions", "[compi
|
||||
REQUIRE_FALSE(lhs ^ lhs);
|
||||
}
|
||||
|
||||
namespace {
|
||||
struct ImmovableType {
|
||||
ImmovableType() = default;
|
||||
|
||||
ImmovableType(ImmovableType const&) = delete;
|
||||
ImmovableType& operator=(ImmovableType const&) = delete;
|
||||
ImmovableType(ImmovableType&&) = delete;
|
||||
ImmovableType& operator=(ImmovableType&&) = delete;
|
||||
|
||||
friend bool operator==(ImmovableType const&, ImmovableType const&) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
TEST_CASE("Immovable types are supported in basic assertions", "[compilation][.approvals]") {
|
||||
REQUIRE(ImmovableType{} == ImmovableType{});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user