Square and cubic UDLs renamed

This commit is contained in:
Mateusz Pusz committed 2020-01-09 10:03:41 +01:00
1 parent 159e2c1c02
commit a01c811f5f
13 files changed
+84 -84

No files matched your search

+11 -11
View File
@@ -58,20 +58,20 @@ TEST_CASE("fmt::format on synthesized unit symbols", "[text][fmt]")
SECTION("area")
{
CHECK(fmt::format("{}", 1sq_m) == "1 m²");
CHECK(fmt::format("{}", 1sq_mm) == "1 mm²");
CHECK(fmt::format("{}", 1sq_cm) == "1 cm²");
CHECK(fmt::format("{}", 1sq_km) == "1 km²");
CHECK(fmt::format("{}", 1sq_ft) == "1 ft²");
CHECK(fmt::format("{}", 1m2) == "1 m²");
CHECK(fmt::format("{}", 1mm2) == "1 mm²");
CHECK(fmt::format("{}", 1cm2) == "1 cm²");
CHECK(fmt::format("{}", 1km2) == "1 km²");
CHECK(fmt::format("{}", 1ft2) == "1 ft²");
}
SECTION("volume")
{
CHECK(fmt::format("{}", 1cub_m) == "1 m³");
CHECK(fmt::format("{}", 1cub_mm) == "1 mm³");
CHECK(fmt::format("{}", 1cub_cm) == "1 cm³");
CHECK(fmt::format("{}", 1cub_km) == "1 km³");
CHECK(fmt::format("{}", 1cub_ft) == "1 ft³");
CHECK(fmt::format("{}", 1m3) == "1 m³");
CHECK(fmt::format("{}", 1mm3) == "1 mm³");
CHECK(fmt::format("{}", 1cm3) == "1 cm³");
CHECK(fmt::format("{}", 1km3) == "1 km³");
CHECK(fmt::format("{}", 1ft3) == "1 ft³");
}
SECTION("frequency")
@@ -92,7 +92,7 @@ TEST_CASE("fmt::format on synthesized unit symbols", "[text][fmt]")
SECTION("acceleration")
{
CHECK(fmt::format("{}", 1mps_sq) == "1 m/s²");
CHECK(fmt::format("{}", 1mps2) == "1 m/s²");
}
SECTION("energy")
+3 -3
View File
@@ -41,15 +41,15 @@ TEST_CASE("'pow<N>()' on quantity changes the value and the dimension accordingl
}
SECTION ("'pow<2>(q)' squares both the value and a dimension") {
CHECK(pow<2>(2m) == 4sq_m);
CHECK(pow<2>(2m) == 4m2);
}
SECTION ("'pow<3>(q)' cubes both the value and a dimension") {
CHECK(pow<3>(2m) == 8cub_m);
CHECK(pow<3>(2m) == 8m3);
}
}
TEST_CASE("'sqrt()' on quantity changes the value and the dimension accordingly", "[math][sqrt]")
{
REQUIRE(sqrt(4sq_m) == 2m);
REQUIRE(sqrt(4m2) == 2m);
}