mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 20:34:26 +02:00
Multiply symbot in a printed unit changed to '⋅'
This commit is contained in:
@@ -70,7 +70,7 @@ namespace units {
|
|||||||
os << (first ? "1/" : "/");
|
os << (first ? "1/" : "/");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
os << (first ? "" : "*");
|
os << (first ? "" : "⋅");
|
||||||
}
|
}
|
||||||
os << E::dimension::symbol;
|
os << E::dimension::symbol;
|
||||||
if constexpr(E::den != 1) {
|
if constexpr(E::den != 1) {
|
||||||
|
@@ -88,13 +88,13 @@ TEST_CASE("operator<< on a quantity", "[text][ostream]")
|
|||||||
SECTION("unit::ratio::num == 1 && unit::ratio::den == 1")
|
SECTION("unit::ratio::num == 1 && unit::ratio::den == 1")
|
||||||
{
|
{
|
||||||
stream << 2s * 2m * 2kg;
|
stream << 2s * 2m * 2kg;
|
||||||
REQUIRE(stream.str() == "8 m*kg*s");
|
REQUIRE(stream.str() == "8 m⋅kg⋅s");
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("unit::ratio as an SI prefix")
|
SECTION("unit::ratio as an SI prefix")
|
||||||
{
|
{
|
||||||
stream << 4km * 2s;
|
stream << 4km * 2s;
|
||||||
REQUIRE(stream.str() == "8 [1000]m*s");
|
REQUIRE(stream.str() == "8 [1000]m⋅s");
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("unit::ratio::num != 1 && unit::ratio::den == 1")
|
SECTION("unit::ratio::num != 1 && unit::ratio::den == 1")
|
||||||
@@ -112,25 +112,25 @@ TEST_CASE("operator<< on a quantity", "[text][ostream]")
|
|||||||
SECTION("unit::ratio::num != 1 && unit::ratio::den != 1")
|
SECTION("unit::ratio::num != 1 && unit::ratio::den != 1")
|
||||||
{
|
{
|
||||||
stream << 60.min / 2km;
|
stream << 60.min / 2km;
|
||||||
REQUIRE(stream.str() == "30 [3/50]1/m*s");
|
REQUIRE(stream.str() == "30 [3/50]1/m⋅s");
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("exp::num == 1 && exp::den == 1")
|
SECTION("exp::num == 1 && exp::den == 1")
|
||||||
{
|
{
|
||||||
stream << 4m * 2s;
|
stream << 4m * 2s;
|
||||||
REQUIRE(stream.str() == "8 m*s");
|
REQUIRE(stream.str() == "8 m⋅s");
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("exp::num == 2 && exp::den == 1 for positive exponent")
|
SECTION("exp::num == 2 && exp::den == 1 for positive exponent")
|
||||||
{
|
{
|
||||||
stream << 4m * 2s * 2s;
|
stream << 4m * 2s * 2s;
|
||||||
REQUIRE(stream.str() == "16 m*s^2");
|
REQUIRE(stream.str() == "16 m⋅s^2");
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("exp::num == 2 && exp::den == 1 for negative exponent (first dimension)")
|
SECTION("exp::num == 2 && exp::den == 1 for negative exponent (first dimension)")
|
||||||
{
|
{
|
||||||
stream << 8.s / 2m / 2m;
|
stream << 8.s / 2m / 2m;
|
||||||
REQUIRE(stream.str() == "2 1/m^2*s");
|
REQUIRE(stream.str() == "2 1/m^2⋅s");
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("exp::num == 2 && exp::den == 1 for negative exponent (not first dimension)")
|
SECTION("exp::num == 2 && exp::den == 1 for negative exponent (not first dimension)")
|
||||||
|
Reference in New Issue
Block a user