Skip to content
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

join: failing GNU tests #2634

Closed
10 tasks done
jtracey opened this issue Sep 3, 2021 · 5 comments · Fixed by #3005
Closed
10 tasks done

join: failing GNU tests #2634

jtracey opened this issue Sep 3, 2021 · 5 comments · Fixed by #3005
Labels

Comments

@jtracey
Copy link
Contributor

jtracey commented Sep 3, 2021

Since it seems like it could be useful to have this information somewhere, here are the remaining failing GNU tests for join:

@jfinkels
Copy link
Collaborator

I looked into the first item, labeled (3c). I created a file tests/fixtures/join/fields_2_null_sep.txt that is exactly like fields_2.txt but with a null character instead of a space:

$ cat fields_2_null_sep.txt | tr "\0" "N"
1Na
2Nb
3Nc
4Nd
5Ne
6Nf
7Ng
8Nh
9Ni

Here is the GNU output:

$ join tests/fixtures/join/fields_1.txt tests/fixtures/join/fields_2_null_sep.txt -t "\0"
1^@a
2^@b
3^@c
5^@e
8^@h

Here's ours:

$ ./target/debug/coreutils join tests/fixtures/join/fields_1.txt tests/fixtures/join/fields_2_null_sep.txt -t "\0"
join: multi-character tab \0

This is happening because the input argument \0 is interpreted as two bytes, a literal '\' followed by a literal '0', instead of as a single null byte. Perhaps there is a way to get the clap argument parsing library to respect the escape sequence in the input argument?

@jtracey
Copy link
Contributor Author

jtracey commented Oct 21, 2021

I briefly looked into it when filing this, and saw something similar was accomplished in #2517

@jtracey
Copy link
Contributor Author

jtracey commented Oct 21, 2021

I suppose I should also mention: the thing I was investigating when I last looked at this was:

GNU has --nocheck-order on by default

since it seemed like a simple fix, but it actually seems like GNU doesn't just have that flag enabled by default, they do some other weird, semi-undocumented behavior. I can't recall what it is off the top of my head right now, but IIRC it's visible from the existing GNU tests.

@jtracey
Copy link
Contributor Author

jtracey commented Jan 23, 2022

Once all the open PRs are merged, all the GNU tests for join are passing (note that the CI won't reflect this until the workflows are updated to use the fixed invalid-j test).

@tertsdiepraam
Copy link
Member

Excellent! Could you open a PR to update the workflow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants