Hopefully final touches on the new tab completion.
This commit is contained in:
@@ -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)])
|
||||
|
||||
Reference in New Issue
Block a user