Skip to content

Commit 5445db3

Browse files
committed
Test Stream::parseFloat() with a large number
1 parent 8eb4013 commit 5445db3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: test/src/Stream/test_parseFloat.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,16 @@ TEST_CASE ("Testing parseFloat(LookaheadMode lookahead = SKIP_ALL, char ignore =
4545
mock << "\r\n\t 12.34";
4646
REQUIRE(mock.parseFloat() == 12.34f);
4747
}
48-
WHEN ("A float is provided with too many digits")
48+
WHEN ("A float is provided with too many digits after the decimal point")
4949
{
5050
mock << "3.1415926535897932384";
5151
REQUIRE(mock.parseFloat() == Approx(3.141592654f));
5252
}
53+
WHEN ("A float is larger than LONG_MAX")
54+
{
55+
mock << "602200000000000000000000.00";
56+
REQUIRE(mock.parseFloat() == Approx(6.022e23f));
57+
}
5358
}
5459

5560
TEST_CASE ("Testing parseFloat(LookaheadMode lookahead = SKIP_NONE, char ignore = NO_IGNORE_CHAR)", "[Stream-parseFloat-02]")

0 commit comments

Comments
 (0)