Skip to content

Commit

Permalink
Add test for comparing immovable types
Browse files Browse the repository at this point in the history
  • Loading branch information
horenmar committed Jun 7, 2021
1 parent fa31d58 commit 65c9a1d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/SelfTest/UsageTests/Compilation.tests.cpp
Expand Up @@ -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{});
}

0 comments on commit 65c9a1d

Please sign in to comment.