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

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

No files matched your search

+10
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);
}
}