22
33import pytest
44
5+ from conftest import assert_complete
6+
57
68class TestMake :
79 @pytest .mark .complete ("make -f Ma" , cwd = "make" )
@@ -16,7 +18,7 @@ def test_2(self, bash, completion):
1618
1719 @pytest .mark .complete ("make .cache/" , cwd = "make" , require_cmd = True )
1820 def test_3 (self , bash , completion ):
19- assert completion == "1 2" .split ()
21+ assert completion == ".cache/1 .cache/ 2" .split ()
2022 os .remove (f"{ bash .cwd } /make/extra_makefile" )
2123
2224 @pytest .mark .complete ("make " , cwd = "shared/empty_dir" )
@@ -34,7 +36,7 @@ def test_6(self, bash, completion):
3436
3537 @pytest .mark .complete ("make .cache/." , cwd = "make" , require_cmd = True )
3638 def test_7 (self , bash , completion ):
37- assert completion == ".1 .2" .split ()
39+ assert completion == ".cache/.1 .cache/ .2" .split ()
3840 os .remove (f"{ bash .cwd } /make/extra_makefile" )
3941
4042 @pytest .mark .complete ("make -C make " , require_cmd = True )
@@ -45,3 +47,38 @@ def test_8(self, bash, completion):
4547 @pytest .mark .complete ("make -" , require_cmd = True )
4648 def test_9 (self , completion ):
4749 assert completion
50+
51+
52+ @pytest .mark .bashcomp (require_cmd = True , cwd = "make/test2" )
53+ class TestMake2 :
54+ def test_github_issue_544_1 (self , bash ):
55+ completion = assert_complete (bash , "make ab" )
56+ assert completion == "c/xyz"
57+
58+ def test_github_issue_544_2 (self , bash ):
59+ completion = assert_complete (bash , "make 1" )
60+ assert completion == "23/"
61+
62+ def test_github_issue_544_3 (self , bash ):
63+ completion = assert_complete (bash , "make 123/" )
64+ assert completion == ["123/xaa" , "123/xbb" ]
65+
66+ def test_github_issue_544_4 (self , bash ):
67+ completion = assert_complete (bash , "make 123/xa" )
68+ assert completion == "a"
69+
70+ def test_subdir_1 (self , bash ):
71+ completion = assert_complete (bash , "make sub1" )
72+ assert completion == "test/bar/"
73+
74+ def test_subdir_2 (self , bash ):
75+ completion = assert_complete (bash , "make sub2" )
76+ assert completion == "test/bar/alpha"
77+
78+ def test_subdir_3 (self , bash ):
79+ completion = assert_complete (bash , "make sub3" )
80+ assert completion == "test/"
81+
82+ def test_subdir_4 (self , bash ):
83+ completion = assert_complete (bash , "make sub4" )
84+ assert completion == "sub4test/bar/ sub4test2/foo/gamma" .split ()
0 commit comments