code: def test_vi_macros():
      feed = partial(_feed_cli_with_input, editing_mode=EditingMode.VI)
  
      # Record and execute macro.
      result, cli = feed("\x1bqcahello\x1bq@c\r")
      assert result.text == "hellohello"
      assert result.cursor_position == 9
  
      # Running unknown macro.
      result, cli = feed("\x1b@d\r")
      assert result.text == ""
      assert result.cursor_position == 0
  
      # When a macro is called within a macro.
      # It shouldn't result in eternal recursion.
      result, cli = feed("\x1bqxahello\x1b@xq@x\r")
      assert result.text == "hellohello"
      assert result.cursor_position == 9
  
      # Nested macros.
      result, cli = feed(
          # Define macro 'x'.
          "\x1bqxahello\x1bq"
          # Define macro 'y' which calls 'x'.
          "qya\x1b@xaworld\x1bq"
          # Delete line.
          "2dd"
          # Execute 'y'
          "@y\r"
      )
  
      assert result.text == "helloworld"
  
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 35 for calling a global function with example usage: test_vi_macros() without return types