Fixed issue #267.

This commit is contained in:
Бранимир Караџић
2021-12-01 18:57:24 -08:00
parent bb86fe843b
commit 0f8bd8dfd5
3 changed files with 9 additions and 3 deletions

View File

@@ -333,6 +333,7 @@ TEST_CASE("toString double", "")
REQUIRE(testToString(-270.000000, "-270.0") );
REQUIRE(testToString(2.225073858507201e-308, "2.225073858507201e-308") );
REQUIRE(testToString(-79.39773355813419, "-79.39773355813419") );
REQUIRE(testToString(-1.234567e-9, "-1.234567e-9") );
}
template<typename Ty>

View File

@@ -72,9 +72,11 @@ TEST_CASE("vsnprintf f")
REQUIRE(test("0001.500", "%08.3f", 1.5) );
REQUIRE(test("+001.500", "%+08.3f", 1.5) );
REQUIRE(test("-001.500", "%+08.3f", -1.5) );
REQUIRE(test("0.003906", "%f", 0.00390625) );
REQUIRE(test("0.0039", "%.4f", 0.00390625) );
REQUIRE(test("0.00390625", "%f", 0.00390625) );
REQUIRE(test("-1.234567e-9", "%f", -1.234567e-9) );
REQUIRE(test("0.00390625", "%.8f", 0.00390625) );
REQUIRE(test("-0.00390625", "%.8f", -0.00390625) );
REQUIRE(test("1.50000000000000000", "%.17f", 1.5) );