test: more tests for pow added for units and quantity specs

This commit is contained in:
Mateusz Pusz
2023-06-13 09:21:07 +03:00
parent ee2abaf9f7
commit 16ad71a31a
2 changed files with 21 additions and 0 deletions
@@ -280,6 +280,10 @@ static_assert(is_of_type<kind_of<length> / kind_of<time>, kind_of_<derived_quant
static_assert(is_of_type<kind_of<length / time>, kind_of_<derived_quantity_spec<length_, per<time_>>{}>>);
// power
static_assert(is_of_type<pow<0>(length), dimensionless_>);
static_assert(is_of_type<pow<1>(length), length_>);
static_assert(is_of_type<pow<2, 2>(length), length_>);
static_assert(is_of_type<pow<2>(dimensionless), dimensionless_>);
static_assert(is_of_type<pow<2>(length), derived_quantity_spec<mp_units::power<length_, 2>>>);
static_assert(is_of_type<pow<1, 2>(length), derived_quantity_spec<mp_units::power<length_, 1, 2>>>);
static_assert(is_of_type<pow<1, 2>(length* length), length_>);
@@ -293,6 +297,10 @@ static_assert(
static_assert(is_same_v<decltype(pow<2>(length)), decltype(length * length)>);
static_assert(is_same_v<decltype(pow<2>(length / time)), decltype(length * length / time / time)>);
static_assert(dimensionless * dimensionless == dimensionless);
static_assert(is_of_type<dimensionless * dimensionless, dimensionless_>);
template<auto& t>
concept invalid_operations = requires {
requires !requires { t < t; };