code: def test_basic_html():
      html = HTML("<i>hello</i>")
      assert to_formatted_text(html) == [("class:i", "hello")]
  
      html = HTML("<i><b>hello</b></i>")
      assert to_formatted_text(html) == [("class:i,b", "hello")]
  
      html = HTML("<i><b>hello</b>world<strong>test</strong></i>after")
      assert to_formatted_text(html) == [
          ("class:i,b", "hello"),
          ("class:i", "world"),
          ("class:i,strong", "test"),
          ("", "after"),
      ]
  
      # It's important that `to_formatted_text` returns a `FormattedText`
      # instance. Otherwise, `print_formatted_text` won't recognize it and will
      # print a list literal instead.
      assert isinstance(to_formatted_text(html), FormattedText)
  
file_path: catboost/contrib/python/prompt-toolkit/py3/tests/test_formatted_text.py
imports: from __future__ import annotations
  from prompt_toolkit.formatted_text import ANSI, HTML, FormattedText, PygmentsTokens, Template, merge_formatted_text, to_formatted_text
  from prompt_toolkit.formatted_text.utils import split_lines
label_desc: Use image node_id 1 for calling a global function with example usage: test_basic_html() without return types