|
1 | 1 | import pytest
|
2 | 2 |
|
| 3 | +from conftest import assert_complete |
| 4 | + |
3 | 5 |
|
4 | 6 | class TestSet:
|
5 |
| - @pytest.mark.complete("set no") |
6 |
| - def test_1(self, completion): |
| 7 | + @pytest.mark.parametrize("dash", ["", "-", "--"]) |
| 8 | + def test_basic(self, bash, dash): |
| 9 | + completion = assert_complete(bash, f"set {dash} ") |
7 | 10 | assert completion
|
| 11 | + |
| 12 | + @pytest.mark.parametrize("prefix", ["-", "+"]) |
| 13 | + def test_options(self, bash, prefix): |
| 14 | + completion = assert_complete(bash, f"set {prefix}") |
| 15 | + assert f"{prefix}o" in completion |
| 16 | + assert "+-" not in completion |
| 17 | + |
| 18 | + @pytest.mark.parametrize("prefix", ["-", "+"]) |
| 19 | + def test_o_args(self, bash, prefix): |
| 20 | + completion = assert_complete(bash, f"set {prefix}o ") |
| 21 | + assert any(x.startswith("no") for x in completion) |
| 22 | + |
| 23 | + @pytest.mark.parametrize("dash,prefix", [["-", "--"], ["-", "+"]]) |
| 24 | + def test_options_after_dash_or_dashdash(self, bash, dash, prefix): |
| 25 | + completion = assert_complete(bash, f"set {dash} {prefix}") |
| 26 | + assert not completion |
0 commit comments