From cd61e077b7d1c1d73f9fcb4578e4c485ecda021a Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 20 Feb 2024 19:59:46 +0100 Subject: [PATCH] test: a few `quantity_spec` tests added --- test/static/quantity_spec_test.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/static/quantity_spec_test.cpp b/test/static/quantity_spec_test.cpp index b845e4c8..862ac0c9 100644 --- a/test/static/quantity_spec_test.cpp +++ b/test/static/quantity_spec_test.cpp @@ -198,6 +198,8 @@ static_assert(is_of_type(length) / pow<2>(length), dimensionless_>); static_assert(is_of_type(length) / length, length_>); static_assert(is_of_type(length), derived_quantity_spec>>); +static_assert(is_of_type>>); + static_assert(is_of_type>); static_assert(is_of_type>>); @@ -625,6 +627,10 @@ static_assert(convertible_impl(power / power, efficiency) == explicit_conversion static_assert(convertible_impl(stress / stress, strain) == explicit_conversion); static_assert(convertible_impl(stress / stress, efficiency) == explicit_conversion); +// specialized dimensionless to dimensionless and back +static_assert(convertible_impl(height / width, dimensionless) == yes); +static_assert(convertible_impl(dimensionless, height / width) == explicit_conversion); + // derived with dimensionless remainder after explosion // TODO revise that static_assert(convertible_impl(distance / speed, time) == yes);