-
-
Notifications
You must be signed in to change notification settings - Fork 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
sharness/t0010: check that all the commands fail when passed a bad flag #4848
Conversation
echo 0 > fail | ||
while read -r cmd | ||
do | ||
test_must_fail $cmd --badflag </dev/null >/dev/null || |
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.
As with --help
(#4841 (comment)), we shouldn't close stdin here.
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.
Ok I will change that.
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.
Done.
while read -r cmd | ||
do | ||
test_must_fail $cmd --badflag </dev/null >/dev/null || | ||
{ echo $cmd exit with code 0 when passed --badflag; echo 1 > 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.
Should definitely quote this. Also, we can probably just touch fail and check to see if it exists (simpler).
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.
About just touching fail, if we do that, we then have to make sure that we remove fail in case of failure, so that later tests that use the same mechanism don't fail just because of the leftover file.
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.
About quoting I tried to follow the same pattern as other tests. I will take a look at quoting everywhere.
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.
Meh. Let's just leave the failure mechanism as-is.
bab346f
to
40016ba
Compare
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
40016ba
to
3a00b7d
Compare
We are not closing stdin anymore. |
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
0cfd2e6
to
30039a7
Compare
I don't understand again why codecov complains. @Kubuxu do you know what happens? |
@chriscool that is normal-ish. |
@Kubuxu ok can you merge this one too? |
@chriscool I can't, currently only Why can. |
Thanks @chriscool :) Welcome back! |
When any command is passed a flag it doesn't understand, like
--badflag
for example, it should just fail.Let's check that in a sharness test.
See #4841 for more context.