Description
In previous versions of Grails before JsonSlurper was significantly changed, this test passed. However, it fails in Groovy 2.3.x (tested up to 2.3.3).
void testParseNumWithDecimals() { def i = parser.parseText('123.40') BigDecimal i2 = 123.40G assert i instanceof BigDecimal assert i == i2 }
This test should be added to https://github.com/groovy/groovy-core/blob/GROOVY_2_3_X/subprojects/groovy-json/src/test/groovy/groovy/json/JsonSlurperTest.groovy
In Groovy 2.3.3, the assertion fails as i = 123.4G, not 123.40G.
Attachments
Issue Links
- is duplicated by
-
GROOVY-7483 JSONSlurper returns wrong value for floating point in Groovy 2.4.3
- Closed