mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 01:28:56 +00:00
Test parsing bash command substitution
This is to help address bad corrections like the following (note the position of the -p flag): thefuck 'git log $(git ls-files thefuck | grep python_command) -p' git log $(git ls-files thefuck | grep -p python_command) [enter/↑/↓/ctrl+c]
This commit is contained in:
parent
785cb83ff3
commit
892e8a8e65
@ -56,3 +56,8 @@ class TestBash(object):
|
|||||||
def test_get_history(self, history_lines, shell):
|
def test_get_history(self, history_lines, shell):
|
||||||
history_lines(['ls', 'rm'])
|
history_lines(['ls', 'rm'])
|
||||||
assert list(shell.get_history()) == ['ls', 'rm']
|
assert list(shell.get_history()) == ['ls', 'rm']
|
||||||
|
|
||||||
|
def test_split_command(self, shell):
|
||||||
|
command = 'git log $(git ls-files thefuck | grep python_command) -p'
|
||||||
|
command_parts = ['git', 'log', '$(git ls-files thefuck | grep python_command)', '-p']
|
||||||
|
assert shell.split_command(command) == command_parts
|
||||||
|
Loading…
x
Reference in New Issue
Block a user