diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py index c87301cae..dbd6de06b 100644 --- a/tests/helpers/fixtures.py +++ b/tests/helpers/fixtures.py @@ -146,6 +146,8 @@ def _generate_cmdline_tests(): # Command with no_cmd_split combined with an "invalid" command -> valid for item in itertools.product(['bind x open'], separators, invalid): yield TestCase(''.join(item), True) + # Partial command + yield TestCase('message-i', False) @pytest.fixture(params=_generate_cmdline_tests(), ids=lambda e: e.cmd) diff --git a/tests/unit/commands/test_runners.py b/tests/unit/commands/test_runners.py index b12f5e9f3..11d85ea90 100644 --- a/tests/unit/commands/test_runners.py +++ b/tests/unit/commands/test_runners.py @@ -51,3 +51,12 @@ class TestCommandRunner: assert result.count == 20 assert result.args == ['down'] assert result.cmdline == ['scroll', 'down'] + + def test_partial_parsing(self): + """Test partial parsing with a runner where it's enabled. + + The same with it being disabled is tested by test_parse_all. + """ + cr = runners.CommandRunner(0, partial_match=True) + result = cr.parse('message-i', aliases=False) + assert result.cmd.name == 'message-info'