Repository navigation
r.geomorphon: Rewrite with parson and add json test - #7122
Conversation
|
When I run the new test without the change, I get: So the PR changes the way the floating point values are printed? It's not a big deal, but it would be good to clarify. |
Yes, The old path went through format_token_common(), which used %.2f for T_MTR, so the number was rounded before it reached JSON. |
The old path went through format_token_common(), which used %.2f for T_MTR, so the number was rounded before it reached JSON
|
How does the new JSON test for As far as it looks on the diff, the test does not verify the presence of the four keys and does no verify the two values. Could someone verify this? I do not have GRASS rigged up now. |
This PR addresses #6970
I have tried to write this in a cleaner way covering all edge cases. I have also added one test with nested loops to check each key-value pair (with floating-point handling). However, if it looks like too much, we can just use assertEqual. I have removed a few keys like timestamp and generator from expected output as they might cause problems.
Let me know if any changes are needed from my side or if tests need to be modified (or if expected values need to be simplified).