Skip to content

Commit

Permalink
test(make): add test cases for GitHub scop#544
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Sep 3, 2021
1 parent 8a4a499 commit 734f282
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/fixtures/make/test2/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# makefile

all: abc/xyz
.PHONY: abc/xyz
abc/xyz 123/xaa 123/xbb:
mkdir -p $(@:/%=)
date > $@
21 changes: 21 additions & 0 deletions test/t/test_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import pytest

from conftest import assert_complete


class TestMake:
@pytest.mark.complete("make -f Ma", cwd="make")
Expand Down Expand Up @@ -45,3 +47,22 @@ def test_8(self, bash, completion):
@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 == ["xaa", "xbb"]

def test_github_issue_544_4(self, bash):
completion = assert_complete(bash, "make 123/xa")
assert completion == "a"

0 comments on commit 734f282

Please sign in to comment.