Fixed reading "true" as a float (issue #516)

This commit is contained in:
Benoit Blanchon
2017-06-03 16:22:26 +02:00
parent 98413089f6
commit bff77abe6a
6 changed files with 26 additions and 8 deletions

View File

@ -101,6 +101,11 @@ TEST_CASE("parseFloat<float>()") {
checkInf<float>("+inf", false);
checkInf<float>("-inf", true);
}
SECTION("Boolean") {
check<float>("false", 0.0f);
check<float>("true", 1.0f);
}
}
TEST_CASE("parseFloat<double>()") {
@ -167,4 +172,9 @@ TEST_CASE("parseFloat<double>()") {
checkNaN<double>("NaN");
checkNaN<double>("nan");
}
SECTION("Boolean") {
check<double>("false", 0.0);
check<double>("true", 1.0);
}
}