Add test for comparing immovable types

This commit is contained in:
Martin Hořeňovský 2021-06-07 15:17:46 +02:00
parent fa31d58934
commit 65c9a1d31a
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
1 changed files with 18 additions and 0 deletions

View File

@ -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{});
}