diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/src/new_type_constructor_suite.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/src/new_type_constructor_suite.cpp b/test/src/new_type_constructor_suite.cpp index fa4c0b7..27b7452 100644 --- a/test/src/new_type_constructor_suite.cpp +++ b/test/src/new_type_constructor_suite.cpp @@ -38,6 +38,27 @@ inline namespace constructor_tests ASSERT((std::is_constructible_v<nt_old, OldType>)); } + auto a_new__type_instance_can_be_copy_constructed_if_the_base_type_can_be_copy_constructed() -> void + { + using type_alias = nt::new_type<int, struct tag_type>; + ASSERT((std::is_copy_constructible_v<type_alias>)); + } + + auto a_new__type_instance_can_not_be_copy_constructed_if_the_base_type_can_not_be_copy_constructed() -> void + { + struct not_copy_constructible + { + not_copy_constructible() = default; + not_copy_constructible(not_copy_constructible const &) = delete; + not_copy_constructible(not_copy_constructible &&) = default; + auto operator=(not_copy_constructible const &) -> not_copy_constructible & = default; + auto operator=(not_copy_constructible &&) -> not_copy_constructible & = default; + }; + + using type_alias = nt::new_type<not_copy_constructible, struct tag_type>; + ASSERT(!(std::is_copy_constructible_v<type_alias>)); + } + } // namespace constructor_tests auto new_type_constructor_suite() -> std::pair<cute::suite, std::string> @@ -63,6 +84,8 @@ auto new_type_constructor_suite() -> std::pair<cute::suite, std::string> KAWAII(a_new__type_based_on_a_fundamental_type_can_be_constructed_with_a_value_of_fundamental_type<float>), KAWAII(a_new__type_based_on_a_fundamental_type_can_be_constructed_with_a_value_of_fundamental_type<double>), KAWAII(a_new__type_based_on_a_fundamental_type_can_be_constructed_with_a_value_of_fundamental_type<long double>), + KAWAII(a_new__type_instance_can_be_copy_constructed_if_the_base_type_can_be_copy_constructed), + KAWAII(a_new__type_instance_can_not_be_copy_constructed_if_the_base_type_can_not_be_copy_constructed), }, "new_type Constructor Tests"}; }
\ No newline at end of file |
