diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:03:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:03:19 +0000 |
commit | 6c09f2a45c5541e9c207d14fc7aa21a4a0066bde (patch) | |
tree | 0221189d367bf661f6f9493c4f17a03f0dd4b7d2 /test/t/test_make.py | |
parent | Releasing progress-linux version 1:2.11-8~progress7.99u1. (diff) | |
download | bash-completion-6c09f2a45c5541e9c207d14fc7aa21a4a0066bde.tar.xz bash-completion-6c09f2a45c5541e9c207d14fc7aa21a4a0066bde.zip |
Merging upstream version 1:2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/t/test_make.py')
-rw-r--r-- | test/t/test_make.py | 56 |
1 files changed, 49 insertions, 7 deletions
diff --git a/test/t/test_make.py b/test/t/test_make.py index 19861b0..34fc7e5 100644 --- a/test/t/test_make.py +++ b/test/t/test_make.py @@ -2,6 +2,8 @@ import os import pytest +from conftest import assert_complete + class TestMake: @pytest.mark.complete("make -f Ma", cwd="make") @@ -12,12 +14,12 @@ class TestMake: def test_2(self, bash, completion): """Hidden targets.""" assert completion == ".cache/ .test_passes".split() - os.remove("%s/make/%s" % (bash.cwd, "extra_makefile")) + os.remove(f"{bash.cwd}/make/extra_makefile") @pytest.mark.complete("make .cache/", cwd="make", require_cmd=True) def test_3(self, bash, completion): - assert completion == "1 2".split() - os.remove("%s/make/%s" % (bash.cwd, "extra_makefile")) + assert completion == ".cache/1 .cache/2".split() + os.remove(f"{bash.cwd}/make/extra_makefile") @pytest.mark.complete("make ", cwd="shared/empty_dir") def test_4(self, completion): @@ -30,18 +32,58 @@ class TestMake: @pytest.mark.complete("make ", cwd="make", require_cmd=True) def test_6(self, bash, completion): assert completion == "all clean extra_makefile install sample".split() - os.remove("%s/make/%s" % (bash.cwd, "extra_makefile")) + os.remove(f"{bash.cwd}/make/extra_makefile") @pytest.mark.complete("make .cache/.", cwd="make", require_cmd=True) def test_7(self, bash, completion): - assert completion == ".1 .2".split() - os.remove("%s/make/%s" % (bash.cwd, "extra_makefile")) + assert completion == ".cache/.1 .cache/.2".split() + os.remove(f"{bash.cwd}/make/extra_makefile") @pytest.mark.complete("make -C make ", require_cmd=True) def test_8(self, bash, completion): assert completion == "all clean extra_makefile install sample".split() - os.remove("%s/make/%s" % (bash.cwd, "extra_makefile")) + os.remove(f"{bash.cwd}/make/extra_makefile") + + @pytest.mark.complete("make -nC make ", require_cmd=True) + def test_8n(self, bash, completion): + assert completion == "all clean extra_makefile install sample".split() + os.remove(f"{bash.cwd}/make/extra_makefile") @pytest.mark.complete("make -", require_cmd=True) def test_9(self, completion): assert completion + + +@pytest.mark.bashcomp(require_cmd=True, cwd="make/test2") +class TestMake2: + def test_github_issue_544_1(self, bash): + completion = assert_complete(bash, "make ab") + assert completion == "c/xyz" + + def test_github_issue_544_2(self, bash): + completion = assert_complete(bash, "make 1") + assert completion == "23/" + + def test_github_issue_544_3(self, bash): + completion = assert_complete(bash, "make 123/") + assert completion == ["123/xaa", "123/xbb"] + + def test_github_issue_544_4(self, bash): + completion = assert_complete(bash, "make 123/xa") + assert completion == "a" + + def test_subdir_1(self, bash): + completion = assert_complete(bash, "make sub1") + assert completion == "test/bar/" + + def test_subdir_2(self, bash): + completion = assert_complete(bash, "make sub2") + assert completion == "test/bar/alpha" + + def test_subdir_3(self, bash): + completion = assert_complete(bash, "make sub3") + assert completion == "test/" + + def test_subdir_4(self, bash): + completion = assert_complete(bash, "make sub4") + assert completion == "sub4test/bar/ sub4test2/foo/gamma".split() |