yaml / yaml-test-suite

Comprehensive, language independent Test Suite for YAML
MIT License
172 stars 58 forks source link

Fix test with json rounding issues: #138

Open biojppm opened 1 month ago

biojppm commented 1 month ago

This change addresses a possible confusion in a test case where JSON processors can trim trailing zero digits from the fractional part of floating numbers. It changes zeros to nonzeros in the fractional part, as a way to enforce the processors to keep the digits.

The point is not to be in the place of ambiguity where the processors could reasonably be expected to trim digits.

Another possible solution is to keep the YAML as-is, and ensure the json shows the prices as 450.00 and 2392.00; ie to change the json part to be string-equal to the yaml part, but this will stil run some risk of digit-trimming.