mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 04:07:10 +01:00 
			
		
		
		
	Add test for comparing immovable types
This commit is contained in:
		| @@ -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{}); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský