code: def test_vi_visual_empty_line():
      """
      Test edge case with an empty line in Visual-line mode.
      """
      feed = partial(
          _feed_cli_with_input,
          editing_mode=EditingMode.VI,
          multiline=True,
      )
  
      # 1. Delete first two lines.
      operations = (
          # Three lines of text. The middle one is empty.
          "hello\r\rworld"
          # Go to the start.
          "\x1bgg"
          # Visual line and move down.
          "Vj"
          # Delete.
          "d\r"
      )
      result, cli = feed(operations)
      assert result.text == "world"
  
      # 1. Delete middle line.
      operations = (
          # Three lines of text. The middle one is empty.
          "hello\r\rworld"
          # Go to middle line.
          "\x1bggj"
          # Delete line
          "Vd\r"
      )
  
      result, cli = feed(operations)
      assert result.text == "hello\nworld"
  
imports: from __future__ import annotations
  from functools import partial
  import pytest
  from prompt_toolkit.clipboard import ClipboardData, InMemoryClipboard
  from prompt_toolkit.enums import EditingMode
  from prompt_toolkit.filters import ViInsertMode
  from prompt_toolkit.history import InMemoryHistory
  from prompt_toolkit.input.defaults import create_pipe_input
  from prompt_toolkit.input.vt100_parser import ANSI_SEQUENCES
  from prompt_toolkit.key_binding.bindings.named_commands import prefix_meta
  from prompt_toolkit.key_binding.key_bindings import KeyBindings
  from prompt_toolkit.output import DummyOutput
  from prompt_toolkit.shortcuts import PromptSession
label_desc: Use image node_id 30 for calling a global function with example usage: test_vi_visual_empty_line() without return types