2015-11-04 23:08:13 -02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2015-05-15 19:09:14 -03:00
|
|
|
from thefuck.rules.grep_recursive import match, get_new_command
|
2017-08-31 17:58:56 +02:00
|
|
|
from thefuck.types import Command
|
2015-05-15 19:09:14 -03:00
|
|
|
|
|
|
|
|
|
|
|
def test_match():
|
2017-08-31 17:58:56 +02:00
|
|
|
assert match(Command('grep blah .', 'grep: .: Is a directory'))
|
|
|
|
assert match(Command(u'grep café .', 'grep: .: Is a directory'))
|
|
|
|
assert not match(Command('', ''))
|
2015-05-15 19:09:14 -03:00
|
|
|
|
|
|
|
|
|
|
|
def test_get_new_command():
|
2017-08-31 17:58:56 +02:00
|
|
|
assert get_new_command(Command('grep blah .', '')) == 'grep -r blah .'
|
|
|
|
assert get_new_command(Command(u'grep café .', '')) == u'grep -r café .'
|