ChaiScript/unittests/json_14.chai
Glen Fraser 79d985d6ff Fix JSON parsing for floats with negative exponents
- also add unit tests to cover some broken (now fixed) cases.
2017-10-24 20:10:50 +02:00

6 lines
217 B
ChaiScript

assert_equal(from_json("9.9e-02"), 9.9e-02)
assert_equal(from_json("-13.57e+3"), -13570.0)
assert_equal(from_json("1E-01"), 0.1)
assert_equal(from_json("-314159e-5"), -3.14159)
assert_equal(from_json("5e+04"), 50000)