1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-05 18:31:10 +01:00

#1188: Remove only leading whitespace chars from script

Fix #1188
This commit is contained in:
Pablo Santiago Blum de Aguiar 2021-07-23 20:05:06 +02:00
parent c2df71caed
commit 8e8c80c227
2 changed files with 4 additions and 2 deletions

View File

@ -143,7 +143,9 @@ class TestCommand(object):
([''], None), ([''], None),
(['', ''], None), (['', ''], None),
(['ls', '-la'], 'ls -la'), (['ls', '-la'], 'ls -la'),
(['ls'], 'ls')]) (['ls'], 'ls'),
(['echo \\ '], 'echo \\ '),
(['echo \\\n'], 'echo \\\n')])
def test_from_script(self, script, result): def test_from_script(self, script, result):
if result: if result:
assert Command.from_raw_script(script).script == result assert Command.from_raw_script(script).script == result

View File

@ -344,4 +344,4 @@ def format_raw_script(raw_script):
else: else:
script = ' '.join(raw_script) script = ' '.join(raw_script)
return script.strip() return script.lstrip()