-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: port compgen and quote tests to pytest+pexpect
- Loading branch information
Showing
7 changed files
with
47 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import pytest | ||
|
||
|
||
class TestCompgen: | ||
@pytest.mark.complete(r"compgen -f a\'b/", cwd="compgen") | ||
def test_1(self, completion): | ||
assert not completion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import pytest | ||
|
||
from conftest import assert_bash_exec, TestUnitBase | ||
|
||
|
||
@pytest.mark.bashcomp(cmd=None) | ||
class TestUnitQuote(TestUnitBase): | ||
def test_1(self, bash): | ||
output = assert_bash_exec( | ||
bash, 'quote "a b"', want_output=True, want_newline=False | ||
) | ||
assert output.strip() == "'a b'" | ||
|
||
def test_2(self, bash): | ||
output = assert_bash_exec( | ||
bash, 'quote "a b"', want_output=True, want_newline=False | ||
) | ||
assert output.strip() == "'a b'" | ||
|
||
def test_3(self, bash): | ||
output = assert_bash_exec( | ||
bash, 'quote " a "', want_output=True, want_newline=False | ||
) | ||
assert output.strip() == "' a '" | ||
|
||
def test_4(self, bash): | ||
output = assert_bash_exec( | ||
bash, "quote \"a'b'c\"", want_output=True, want_newline=False | ||
) | ||
assert output.strip() == r"'a'\''b'\''c'" | ||
|
||
def test_5(self, bash): | ||
output = assert_bash_exec( | ||
bash, 'quote "a\'"', want_output=True, want_newline=False | ||
) | ||
assert output.strip() == r"'a'\'''" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.