Skip to content

Conversation

@mattsu2020
Copy link
Contributor

We have made corrections to ensure the GNU coreutils tests pass.

sort-float.sh

mattsu2020 and others added 9 commits December 20, 2025 21:07
Add locale-aware handling for decimal separators (comma vs. period) in general numeric sorting mode. This allows proper sorting of numeric fields in locales where comma is the standard decimal separator, such as many European countries.

Changes include:
- Enabling the "i18n-decimal" feature in uucore dependencies
- Introducing locale_decimal_pt() to retrieve the locale-specific decimal separator
- Updating get_leading_gen() and general_bd_parse() to accept and use the decimal point parameter
- Converting input to standard period notation for parsing when locale uses comma

This fixes sorting inaccuracies for international users with comma-based decimal notation.
…g Option::then

Refactored the `general_bd_parse` function to replace manual mutable vector initialization and conditional assignment with `Option::then` and `as_deref`, making the code more concise and idiomatic while maintaining the same logic for normalizing decimal points.
Add `effective_decimal_pt` function to intelligently select the decimal point based on input content, ensuring correct sorting when locale uses comma but input uses period as decimal separator. This fixes parsing issues in general numeric mode by prioritizing input-based detection over strict locale adherence.
Updated various crates in fuzz/Cargo.lock: windows-sys to 0.61.2, bumpalo to 3.19.1, cc to 1.2.50, crc to 3.3.0, crc-fast to 1.9.0, icu_properties and data to 2.1.2, jiff to 0.2.17. Added fixed_decimal, icu_decimal, and icu_decimal_data for improved functionality and compatibility.
…ntains method

Use input.contains() instead of input.iter().any() for checking presence of comma and dot bytes, improving readability and reducing boilerplate.
Split the uucore dependency features into multiple lines to improve code formatting and maintain consistency with other multi-line dependency declarations.
@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/sort/sort-float is no longer failing!

@sylvestre
Copy link
Contributor

Could you please add a test to make sure we don't regress in the future?
Thanks

@sylvestre
Copy link
Contributor

Did you run some benchmark on this btw?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants