Skip to content

Commit 541f7b1

Browse files
committed
test(function): add tests for existing/non-existing functions
1 parent f575693 commit 541f7b1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/t/test_function.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
import pytest
22

3+
from conftest import assert_bash_exec, assert_complete
34

5+
6+
@pytest.mark.bashcomp(ignore_env=r"^\+declare -f fn$")
47
class TestFunction:
58
@pytest.mark.complete("function _parse_")
69
def test_1(self, completion):
710
assert completion
11+
12+
@pytest.mark.complete("function non_existent_function ")
13+
def test_2(self, completion):
14+
assert completion == "()"
15+
16+
def test_3(self, bash):
17+
assert_bash_exec(bash, "fn() { echo; }")
18+
completion = assert_complete(bash, "function fn ")
19+
assert completion == "() { ^J echo^J}"

0 commit comments

Comments
 (0)