-
-
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
comm: implement the ordering check #7144
Conversation
GNU testsuite comparison:
|
df0ed16
to
9499902
Compare
GNU testsuite comparison:
|
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.
Are the tests check_order
, defaultcheck_order
, and nocheck_order
still needed? They are currently marked as "ignore".
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.
I missed them
ok if I fix that in a following PR?
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.
yep :)
@@ -404,7 +409,7 @@ fn unintuitive_default_behavior_1() { | |||
scene | |||
.ucmd() | |||
.args(&["defaultcheck_unintuitive_1", "defaultcheck_unintuitive_2"]) | |||
.succeeds() | |||
.fails() |
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.
Here it might be useful to have a comment that the behavior differs from GNU comm
, which doesn't fail.
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.
are you sure? it fails for me
$ echo "m\nh\nn\no\nc\np\n" > defaultcheck_unintuitive_1
$ echo "m\nh\nn\no\np\n" > defaultcheck_unintuitive_2
$ /usr/bin/comm defaultcheck_unintuitive_1 defaultcheck_unintuitive_2
$ echo $?
1
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.
I think the reason it fails for you is that echo
adds a trailing newline by default.
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.
oh, right. Comment added :)
} | ||
|
||
self.last_line = current_line.to_vec(); | ||
is_ordered || !self.check_order |
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.
I'm struggling with the || !self.check_order
part. I think this functionality should be somewhere else. It feels illogical that something that's not ordered suddenly can become ordered ;-)
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.
not sure how to fix that?! sorry
166b120
to
85f2604
Compare
GNU testsuite comparison:
|
A few comments: * skip if the two args are pointing to the same file * skip if the same content in the two files * implement --check-order * implement --nocheck-order * output the right things on stderr Should pass: tests/misc/comm
GNU testsuite comparison:
|
Well done :) |
A few comments:
Should pass: tests/misc/comm