summaryrefslogtreecommitdiff
path: root/test/t/unit/test_unit_longopt.py
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gabriel@inconstante.net.br>2020-08-03 18:43:13 -0300
committerGabriel F. T. Gomes <gabriel@inconstante.net.br>2020-08-03 18:43:13 -0300
commit95623d39d6029ba78ec96ad5ea08e9ac12629b91 (patch)
treeea0fe36eb5e6f40e0a1f765d44c4b0c0b2bfb089 /test/t/unit/test_unit_longopt.py
parent019f3cc463db63abc6460f97deb488deec43840b (diff)
downloadbash-completion-upstream.tar.gz
New upstream version 2.11upstream/2.11upstream
Diffstat (limited to 'test/t/unit/test_unit_longopt.py')
-rw-r--r--test/t/unit/test_unit_longopt.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/t/unit/test_unit_longopt.py b/test/t/unit/test_unit_longopt.py
index ac0ac836..c5488e34 100644
--- a/test/t/unit/test_unit_longopt.py
+++ b/test/t/unit/test_unit_longopt.py
@@ -11,6 +11,8 @@ class TestUnitLongopt:
def functions(self, request, bash):
assert_bash_exec(bash, "_grephelp() { cat _longopt/grep--help.txt; }")
assert_bash_exec(bash, "complete -F _longopt _grephelp")
+ assert_bash_exec(bash, "_various() { cat _longopt/various.txt; }")
+ assert_bash_exec(bash, "complete -F _longopt _various")
@pytest.mark.complete("_grephelp --")
def test_1(self, functions, completion):
@@ -32,3 +34,19 @@ class TestUnitLongopt:
assert completion
assert any(x.endswith("=") for x in completion)
assert any(not x.endswith("=") for x in completion)
+
+ @pytest.mark.complete("_various --")
+ def test_no_dashdashdash(self, functions, completion):
+ assert all(not x.startswith("---") for x in completion)
+
+ @pytest.mark.complete("_various --")
+ def test_no_trailingdash(self, functions, completion):
+ assert all(not x.endswith("-") for x in completion)
+
+ @pytest.mark.complete("_various --")
+ def test_underscore(self, functions, completion):
+ assert "--foo_bar" in completion
+
+ @pytest.mark.complete("_various --")
+ def test_equals(self, functions, completion):
+ assert "--foo=" in completion