-
Notifications
You must be signed in to change notification settings - Fork 340
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
Fixes #792 cmd empty echo #793
Fixes #792 cmd empty echo #793
Conversation
@@ -77,7 +77,7 @@ def get_syspaths(cls): | |||
|
|||
# detect system paths using registry | |||
def gen_expected_regex(parts): | |||
whitespace = "[\s]+" | |||
whitespace = r"[\s]+" |
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.
Eliminates a warning (invalid escape sequence)
I reran the tests since we did not have the PR workflow fixed back then. |
expected_output = ['"{}"'.format(o) for o in expected_output] | ||
# it but this means we need to wrap our expected output as well. Only | ||
# exception is empty string, which is just passed through. | ||
expected_output = ['"{}"'.format(o) if o else o for o in expected_output] |
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.
This was necessary since the interpretation of empty string in quotes would not match throughout the shells.
Not sure if this is correct but the data itself is correct (empty) and this is what I wanted to compare here.
I want to take a closer look at the code. While this does strip out the ECHO output it still leaves empty lines for me. Here is a comparison of 2.47.11, 2.47.13 and the current state of this MR. While the empty lines are no show stopper they are still not needed and i am a bit confused by the difference. Specifically:
|
I addressed the message in a recent fix, I just matched it to the other shells. As to the newline: |
Without it
info('')
generatesecho is ON.
on cmd's stdout.EDIT: More context
In
cmd
andinfo('')
results inecho ""
which is interpreted as command to show the current state of echo.The way to echo an empty line is
echo.
.I've also added a test that makes sure that info('') is interpreted as empty line.