Repository navigation
test: force C locale for printf in cellAreaM2 CLI test - #1176
Merged
Merged
Conversation
The testCliCellAreaM2 test pipes h3 output through 'xargs printf %.3f', which formats the decimal separator per the system locale. On locales that use ',' as the decimal separator the test produces 265092558,128 and fails, even though h3 itself outputs the value correctly. Run printf under LC_ALL=C so the separator is always '.'. Fixes uber#1170
isaacbrodsky
approved these changes
Jun 21, 2026
dfellis
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1170.
testCliCellAreaM2runs:printf's%fconversion uses the system locale's decimal separator. On a locale such asen_SE.UTF-8(which uses,), the pipeline produces265092558,128, so the comparison against the expected265092558.128fails — which blocks the build (e.g. the Arch AUR package, as reported).h3itself outputs the value correctly (265092558.1282817721); only the test'sprintfpost-processing is locale-sensitive.Fix: run
printfunder the C locale so the decimal separator is always.:env LC_ALL=Cis used (rather than a bareLC_ALL=C printf) becauseprintfis launched byxargs, which doesn't interpretVAR=valueenv assignments. This is the only CLI test fixture that usesprintf, so no other tests are affected.