From cec1eaa7686831722f81c153b197b9352c51007b Mon Sep 17 00:00:00 2001 From: Roland Bock Date: Mon, 5 Aug 2024 20:26:54 +0200 Subject: [PATCH] More tests --- tests/core/types/aggregate_function.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/core/types/aggregate_function.cpp b/tests/core/types/aggregate_function.cpp index 804a1664..350fe5d2 100644 --- a/tests/core/types/aggregate_function.cpp +++ b/tests/core/types/aggregate_function.cpp @@ -58,6 +58,15 @@ void test_aggregate_functions(Value v) static_assert(sqlpp::has_enabled_as::value, ""); static_assert(sqlpp::has_enabled_as::value, ""); + // Aggregate functions have a name + static_assert(sqlpp::has_name::value, ""); + static_assert(sqlpp::has_name::value, ""); + static_assert(sqlpp::has_name::value, ""); + + static_assert(sqlpp::name_tag_of_t::_alias_t::_literal == sqlpp::string_view("count"), ""); + static_assert(sqlpp::name_tag_of_t::_alias_t::_literal == sqlpp::string_view("max"), ""); + static_assert(sqlpp::name_tag_of_t::_alias_t::_literal == sqlpp::string_view("min"), ""); + // Aggregate functions enable comparison member functions. static_assert(sqlpp::has_enabled_comparison::value, ""); static_assert(sqlpp::has_enabled_comparison::value, ""); @@ -97,6 +106,13 @@ void test_numeric_aggregate_functions(Value v) static_assert(sqlpp::has_enabled_as::value, ""); static_assert(sqlpp::has_enabled_as::value, ""); + // Aggregate functions have a name + static_assert(sqlpp::has_name::value, ""); + static_assert(sqlpp::has_name::value, ""); + + static_assert(sqlpp::name_tag_of_t::_alias_t::_literal == sqlpp::string_view("sum"), ""); + static_assert(sqlpp::name_tag_of_t::_alias_t::_literal == sqlpp::string_view("avg"), ""); + // Aggregate functions enable OVER. static_assert(sqlpp::has_enabled_over::value, ""); static_assert(sqlpp::has_enabled_over::value, "");