forked from mpusz/mp-units
Fixed text formatting for current density in unit test
This commit is contained in:
@@ -131,8 +131,8 @@ struct dim_catalytic_activity : derived_dimension<Child, U, exp<T, -1>, exp<M, 1
|
|||||||
template<typename Child, Unit U, DimensionOf<dim_energy> E, DimensionOf<dim_mass> M>
|
template<typename Child, Unit U, DimensionOf<dim_energy> E, DimensionOf<dim_mass> M>
|
||||||
struct dim_absorbed_dose : derived_dimension<Child, U, exp<E, 1>, exp<M, -1>> {};
|
struct dim_absorbed_dose : derived_dimension<Child, U, exp<E, 1>, exp<M, -1>> {};
|
||||||
|
|
||||||
template<typename Child, Unit U, DimensionOf<dim_electric_current> I, DimensionOf<dim_area> A>
|
template<typename Child, Unit U, DimensionOf<dim_electric_current> I, DimensionOf<dim_length> L>
|
||||||
struct dim_current_density : derived_dimension<Child, U, exp<I, 1>, exp<A, -1>> {};
|
struct dim_current_density : derived_dimension<Child, U, exp<I, 1>, exp<L, -2>> {};
|
||||||
|
|
||||||
} // namespace physical
|
} // namespace physical
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include <units/physical/dimensions.h>
|
#include <units/physical/dimensions.h>
|
||||||
#include <units/physical/si/current.h>
|
#include <units/physical/si/current.h>
|
||||||
#include <units/physical/si/area.h>
|
#include <units/physical/si/length.h>
|
||||||
#include <units/physical/si/prefixes.h>
|
#include <units/physical/si/prefixes.h>
|
||||||
#include <units/quantity.h>
|
#include <units/quantity.h>
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ namespace units::si {
|
|||||||
|
|
||||||
struct ampere_per_metre_sq : unit<ampere_per_metre_sq> {};
|
struct ampere_per_metre_sq : unit<ampere_per_metre_sq> {};
|
||||||
|
|
||||||
struct dim_current_density : physical::dim_current_density<dim_current_density, ampere_per_metre_sq, dim_electric_current, dim_area> {};
|
struct dim_current_density : physical::dim_current_density<dim_current_density, ampere_per_metre_sq, dim_electric_current, dim_length> {};
|
||||||
|
|
||||||
template<Unit U, Scalar Rep = double>
|
template<Unit U, Scalar Rep = double>
|
||||||
using current_density = quantity<dim_current_density, U, Rep>;
|
using current_density = quantity<dim_current_density, U, Rep>;
|
||||||
|
@@ -236,7 +236,7 @@ TEST_CASE("fmt::format on synthesized unit symbols", "[text][fmt]")
|
|||||||
SECTION("current density")
|
SECTION("current density")
|
||||||
{
|
{
|
||||||
CHECK(fmt::format("{}", 1q_A_per_m2) == "1 A/m²");
|
CHECK(fmt::format("{}", 1q_A_per_m2) == "1 A/m²");
|
||||||
CHECK(fmt::format("{:%q %AQ}", 1q_A_per_m2) == "1 A/m^2");
|
CHECK(fmt::format("{:%Q %Aq}", 1q_A_per_m2) == "1 A/m^2");
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("incoherent units with powers")
|
SECTION("incoherent units with powers")
|
||||||
|
Reference in New Issue
Block a user