Hopefully final touches on the new tab completion.

This commit is contained in:
Storm Dragon
2026-05-09 00:14:36 -04:00
parent 0af7d94014
commit be78db0d58
4 changed files with 93 additions and 1 deletions
+37
View File
@@ -81,6 +81,43 @@ def test_unique_completion_speaks_inserted_suffix():
assert state["lastProcessedDelta"] == "cuments/"
@pytest.mark.unit
def test_small_completion_speaks_inserted_suffix():
manager, env, _input_manager = _build_env(
"cd gi".ljust(20), {"x": 5, "y": 0}
)
manager.capture_if_tab()
_set_screen_update(
env,
"cd git/".ljust(20),
{"x": 7, "y": 0},
delta="t/",
typing=True,
)
assert manager.process_update() == "t/"
@pytest.mark.unit
def test_completion_processed_once_for_cursor_and_screen_update():
manager, env, _input_manager = _build_env(
"cd gi".ljust(20), {"x": 5, "y": 0}
)
manager.capture_if_tab()
_set_screen_update(
env,
"cd git/".ljust(20),
{"x": 7, "y": 0},
delta="t/",
typing=True,
)
assert manager.process_update() == "t/"
assert manager.process_update() == ""
@pytest.mark.unit
def test_candidate_list_speaks_visible_list_without_cursor_advance():
old_text = "\n".join(["$ cd Do".ljust(20), "".ljust(20), "".ljust(20)])