-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cut-huge-range.sh: make cut fails on usize::MAX #4988
Conversation
GNU testsuite comparison:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason to adjust the test instead of our code?
My theory for why we support this and GNU doesn't is that we might be using an inclusive range internally and that GNU would be using an exclusive range internally, parsed from an inclusive range. If everything else works as expected I don't see a reason explicitly break support for that single value. For context, though that might be obvious, the value in the GNU test is |
Honestly, I don't know why it is done this way. I am not sure how to update the parsing code to do this:
|
078c494
to
0cb60d1
Compare
not sure why github action didn't comment but it passes: |
To test them: $ cargo test -p uucore --features ranges
GNU fails with
$ cut -b18446744073709551615 /dev/null
but we are able to support this value
we both fail with
$ cut -b18446744073709551616 /dev/null