mirror of
https://github.com/nvbn/thefuck.git
synced 2025-10-30 14:44:05 +00:00
⚠️ Remove settings param from rules match, get_new_command and side_effect
This commit is contained in:
@@ -9,20 +9,20 @@ def sed_unterminated_s():
|
||||
|
||||
|
||||
def test_match(sed_unterminated_s):
|
||||
assert match(Command('sed -e s/foo/bar', stderr=sed_unterminated_s), None)
|
||||
assert match(Command('sed -es/foo/bar', stderr=sed_unterminated_s), None)
|
||||
assert match(Command('sed -e s/foo/bar -e s/baz/quz', stderr=sed_unterminated_s), None)
|
||||
assert not match(Command('sed -e s/foo/bar'), None)
|
||||
assert not match(Command('sed -es/foo/bar'), None)
|
||||
assert not match(Command('sed -e s/foo/bar -e s/baz/quz'), None)
|
||||
assert match(Command('sed -e s/foo/bar', stderr=sed_unterminated_s))
|
||||
assert match(Command('sed -es/foo/bar', stderr=sed_unterminated_s))
|
||||
assert match(Command('sed -e s/foo/bar -e s/baz/quz', stderr=sed_unterminated_s))
|
||||
assert not match(Command('sed -e s/foo/bar'))
|
||||
assert not match(Command('sed -es/foo/bar'))
|
||||
assert not match(Command('sed -e s/foo/bar -e s/baz/quz'))
|
||||
|
||||
|
||||
def test_get_new_command(sed_unterminated_s):
|
||||
assert get_new_command(Command('sed -e s/foo/bar', stderr=sed_unterminated_s), None) \
|
||||
assert get_new_command(Command('sed -e s/foo/bar', stderr=sed_unterminated_s)) \
|
||||
== 'sed -e s/foo/bar/'
|
||||
assert get_new_command(Command('sed -es/foo/bar', stderr=sed_unterminated_s), None) \
|
||||
assert get_new_command(Command('sed -es/foo/bar', stderr=sed_unterminated_s)) \
|
||||
== 'sed -es/foo/bar/'
|
||||
assert get_new_command(Command(r"sed -e 's/\/foo/bar'", stderr=sed_unterminated_s), None) \
|
||||
assert get_new_command(Command(r"sed -e 's/\/foo/bar'", stderr=sed_unterminated_s)) \
|
||||
== r"sed -e 's/\/foo/bar/'"
|
||||
assert get_new_command(Command(r"sed -e s/foo/bar -es/baz/quz", stderr=sed_unterminated_s), None) \
|
||||
assert get_new_command(Command(r"sed -e s/foo/bar -es/baz/quz", stderr=sed_unterminated_s)) \
|
||||
== r"sed -e s/foo/bar/ -es/baz/quz/"
|
||||
|
||||
Reference in New Issue
Block a user