-
-
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
Fix 'wc' gnu test-suite compatibility #3678
Labels
good first issue
For newcomers!
Comments
cool, are you going to work on this? |
Yes, i just pushed the patch. |
We'll close the issue once the PR has been merged ;p |
sylvestre
pushed a commit
to gkalas8/coreutils
that referenced
this issue
Jun 30, 2022
This change will extract a utility already present in ls to uucore. This utility is used by dir and vdir too, which are adjusted to look it up in uucode. No further changes to ls, dir or dirv intended. The change here largely fiddles with the output of uu_wc to match that of GNU wc. This is the case to the extent to make unit tests pass, however, there are differences remaining. One specific difference I did not tackle is that GNU wc will not align the output columns (compute_number_width() -> 1) in the specific case of the input for --files0-from=- being a named pipe, not real stdin. This difference can be triggered using the following two invocations. - wc --files0-from=- < files0 # use a named pipe, GNU does align - cat files0- | wc --files0-from=- # use real stdin, GNU does not align.
anastygnome
pushed a commit
to anastygnome/coreutils
that referenced
this issue
Jul 1, 2022
This change will extract a utility already present in ls to uucore. This utility is used by dir and vdir too, which are adjusted to look it up in uucode. No further changes to ls, dir or dirv intended. The change here largely fiddles with the output of uu_wc to match that of GNU wc. This is the case to the extent to make unit tests pass, however, there are differences remaining. One specific difference I did not tackle is that GNU wc will not align the output columns (compute_number_width() -> 1) in the specific case of the input for --files0-from=- being a named pipe, not real stdin. This difference can be triggered using the following two invocations. - wc --files0-from=- < files0 # use a named pipe, GNU does align - cat files0- | wc --files0-from=- # use real stdin, GNU does not align.
anastygnome
pushed a commit
to anastygnome/coreutils
that referenced
this issue
Jul 1, 2022
This change will extract a utility already present in ls to uucore. This utility is used by dir and vdir too, which are adjusted to look it up in uucode. No further changes to ls, dir or dirv intended. The change here largely fiddles with the output of uu_wc to match that of GNU wc. This is the case to the extent to make unit tests pass, however, there are differences remaining. One specific difference I did not tackle is that GNU wc will not align the output columns (compute_number_width() -> 1) in the specific case of the input for --files0-from=- being a named pipe, not real stdin. This difference can be triggered using the following two invocations. - wc --files0-from=- < files0 # use a named pipe, GNU does align - cat files0- | wc --files0-from=- # use real stdin, GNU does not align.
baiyuqing
pushed a commit
to baiyuqing/coreutils
that referenced
this issue
Jul 10, 2022
This change will extract a utility already present in ls to uucore. This utility is used by dir and vdir too, which are adjusted to look it up in uucode. No further changes to ls, dir or dirv intended. The change here largely fiddles with the output of uu_wc to match that of GNU wc. This is the case to the extent to make unit tests pass, however, there are differences remaining. One specific difference I did not tackle is that GNU wc will not align the output columns (compute_number_width() -> 1) in the specific case of the input for --files0-from=- being a named pipe, not real stdin. This difference can be triggered using the following two invocations. - wc --files0-from=- < files0 # use a named pipe, GNU does align - cat files0- | wc --files0-from=- # use real stdin, GNU does not align.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The wc utility is using the os_display crate's quotation function to produce quoted filenames on its output. This implementation produces slightly different values than the GNU wc's implementation. Both are valid. Sadly the automated tests will only pass using GNU's notation.
The following example demonstrates the difference.
Filename: 'a\nb' (https://github.com/coreutils/coreutils/blob/master/tests/misc/wc-files0.sh#L44) .
GNU output : 'a'$'\n''b'
uu_wc (os_display) output: $'a\nb'
The ls util implements its own quotation logic in src/uu/ls/quoting_style.rs . This implementation, with the right configuration may produce the GNU compatible output.
In addition, when in files0 mode GNU wc will never align columns. This needs to be mirrored in uu_wc as well.
Tasks:
The text was updated successfully, but these errors were encountered: