code: def test_create_pair_index(app):
      text = (
          ".. index:: pair: docutils; reStructuredText\n"
          ".. index:: pair: Python; interpreter\n"
          ".. index:: pair: Sphinx; documentation tool\n"
          ".. index:: pair: Sphinx; :+1:\n"
          ".. index:: pair: Sphinx; Ель\n"
          ".. index:: pair: Sphinx; ёлка\n"
      )
      restructuredtext.parse(app, text)
      index = IndexEntries(app.env).create_index(app.builder)
      assert len(index) == 7
      assert index[0] == (
          "Symbols",
          [(":+1:", [[], [("Sphinx", [("", "#index-3")])], None])],
      )
      assert index[1] == (
          "D",
          [
              (
                  "documentation tool",
                  [[], [("Sphinx", [("", "#index-2")])], None],
              ),
              (
                  "docutils",
                  [
                      [],
                      [("reStructuredText", [("", "#index-0")])],
                      None,
                  ],
              ),
          ],
      )
      assert index[2] == (
          "I",
          [
              (
                  "interpreter",
                  [[], [("Python", [("", "#index-1")])], None],
              )
          ],
      )
      assert index[3] == (
          "P",
          [
              (
                  "Python",
                  [[], [("interpreter", [("", "#index-1")])], None],
              )
          ],
      )
      assert index[4] == (
          "R",
          [
              (
                  "reStructuredText",
                  [[], [("docutils", [("", "#index-0")])], None],
              )
          ],
      )
      assert index[5] == (
          "S",
          [
              (
                  "Sphinx",
                  [
                      [],
                      [
                          (":+1:", [("", "#index-3")]),
                          ("documentation tool", [("", "#index-2")]),
                          ("ёлка", [("", "#index-5")]),
                          ("Ель", [("", "#index-4")]),
                      ],
                      None,
                  ],
              )
          ],
      )
      assert index[6] == (
          "Е",
          [
              ("ёлка", [[], [("Sphinx", [("", "#index-5")])], None]),
              ("Ель", [[], [("Sphinx", [("", "#index-4")])], None]),
          ],
      )
  
file_path: sphinx/tests/test_environment/test_environment_indexentries.py
imports: import pytest
  from sphinx.environment.adapters.indexentries import IndexEntries
  from sphinx.testing import restructuredtext
label_desc: Use image node_id 2 for calling a global function with example usage: test_create_pair_index(app) without return types