#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include "doctest.h" #include #include #include #include #include #include #include #include #include #include struct dummy_type{}; template struct dummy_container { typedef T value_type; typedef value_type* pointer; typedef value_type& reference; typedef value_type const* const_pointer; typedef value_type const& const_reference; typedef pointer iterator; typedef const_pointer const_iterator; }; TEST_CASE("testing has_xxx traits") { CHECK_UNARY(toml::detail::has_iterator>::value); CHECK_UNARY(toml::detail::has_iterator>::value); CHECK_UNARY(toml::detail::has_iterator>::value); CHECK_UNARY(toml::detail::has_iterator>::value); CHECK_UNARY(toml::detail::has_iterator>::value); CHECK_UNARY(toml::detail::has_iterator>::value); CHECK_UNARY(toml::detail::has_iterator>::value); CHECK_UNARY(toml::detail::has_iterator>::value); CHECK_UNARY(toml::detail::has_iterator>::value); CHECK_UNARY(toml::detail::has_iterator>::value); CHECK_UNARY(toml::detail::has_value_type>::value); CHECK_UNARY(toml::detail::has_value_type>::value); CHECK_UNARY(toml::detail::has_value_type>::value); CHECK_UNARY(toml::detail::has_value_type>::value); CHECK_UNARY(toml::detail::has_value_type>::value); CHECK_UNARY(toml::detail::has_value_type>::value); CHECK_UNARY(toml::detail::has_value_type>::value); CHECK_UNARY(toml::detail::has_value_type>::value); CHECK_UNARY(toml::detail::has_value_type>::value); CHECK_UNARY(toml::detail::has_value_type>::value); CHECK_UNARY(toml::detail::has_key_type>::value); CHECK_UNARY(toml::detail::has_key_type>::value); CHECK_UNARY(toml::detail::has_mapped_type>::value); CHECK_UNARY(toml::detail::has_mapped_type>::value); } TEST_CASE("testing is_xxx traits") { CHECK_UNARY(toml::detail::is_container>::value); CHECK_UNARY(toml::detail::is_container>::value); CHECK_UNARY(toml::detail::is_container>::value); CHECK_UNARY(toml::detail::is_container>::value); CHECK_UNARY(toml::detail::is_container>::value); CHECK_UNARY(toml::detail::is_container>::value); CHECK_UNARY(toml::detail::is_container>::value); CHECK_UNARY(toml::detail::is_container>::value); CHECK_UNARY_FALSE(toml::detail::is_container>::value); CHECK_UNARY_FALSE(toml::detail::is_container>::value); CHECK_UNARY(toml::detail::is_map>::value); CHECK_UNARY(toml::detail::is_map>::value); } TEST_CASE("testing make_index_sequence") { static_assert(std::is_same, toml::cxx::index_sequence<>>::value, ""); static_assert(std::is_same, toml::cxx::index_sequence<0>>::value, ""); static_assert(std::is_same, toml::cxx::index_sequence<0,1>>::value, ""); static_assert(std::is_same, toml::cxx::index_sequence<0,1,2>>::value, ""); static_assert(std::is_same, toml::cxx::index_sequence<0,1,2,3>>::value, ""); static_assert(std::is_same, toml::cxx::index_sequence<0,1,2,3,4>>::value, ""); static_assert(std::is_same, toml::cxx::index_sequence<0,1,2,3,4,5>>::value, ""); static_assert(std::is_same, toml::cxx::index_sequence<0,1,2,3,4,5,6>>::value, ""); static_assert(std::is_same, toml::cxx::index_sequence<0,1,2,3,4,5,6,7>>::value, ""); }