Added concentration

This commit is contained in:
rbrugo authored and Mateusz Pusz committed 2020-04-10 16:36:08 +02:00
1 parent a6614cace2
commit 8ddd7e1233
5 files changed
+65 -2

No files matched your search

@@ -239,6 +239,12 @@ TEST_CASE("fmt::format on synthesized unit symbols", "[text][fmt]")
CHECK(fmt::format("{:%Q %Aq}", 1q_A_per_m2) == "1 A/m^2");
}
SECTION("concentration")
{
CHECK(fmt::format("{}", 1q_mol_per_m3) == "1 mol/m³");
CHECK(fmt::format("{:%Q %Aq}", 1q_mol_per_m3) == "1 mol/m^3");
}
SECTION("incoherent units with powers")
{
CHECK(fmt::format("{}", 1q_mi * 1q_mi * 1q_mi) == "1 [15900351812136/3814697265625 × 10⁹] m³");
+5 -2
View File
@@ -297,8 +297,11 @@ static_assert(detail::unit_text<dim_surface_tension, newton_per_metre>() == "N/m
static_assert(12q_A_per_m2 == 60q_A / 5q_m2);
static_assert(1q_A_per_m2 == 1q_S * 1q_V / 1q_m2);
/* #warning FIX THIS */
/* static_assert(detail::unit_text<dim_current_density, ampere_per_metre_sq>() == basic_symbol_text("A · m²", "A/m^2")); */
static_assert(detail::unit_text<dim_current_density, ampere_per_metre_sq>() == basic_symbol_text("A/m²", "A/m^2"));
// concentration
static_assert(1q_mol_per_m3 == 1q_kg_per_m3 * 1q_mol / 1q_kg);
static_assert(detail::unit_text<dim_concentration, ampere_per_metre_sq>() == basic_symbol_text("mol/m³", "mol/m^2"));
} // namespace