code: def test_search(self):
      Equal = self.assertEqual
      engine = self.engine
      search = engine.search_text
      text = self.text
      pat = self.pat
  
      engine.patvar.set(None)
      # engine.revar.set(pat)
      Equal(search(text), None)
  
      def mark(s):
          # no selection, cursor after 'Hello'
          if s == "insert":
              return "1.5"
          raise TclError
  
      text.index = mark
      Equal(search(text, pat), ("f", (text, pat, 1, 5, True, False)))
      engine.wrapvar.set(False)
      Equal(search(text, pat), ("f", (text, pat, 1, 5, False, False)))
      engine.wrapvar.set(True)
      engine.backvar.set(True)
      Equal(search(text, pat), ("b", (text, pat, 1, 5, True, False)))
      engine.backvar.set(False)
  
      def sel(s):
          if s == "sel.first":
              return "2.10"
          if s == "sel.last":
              return "2.16"
          raise TclError
  
      text.index = sel
      Equal(search(text, pat), ("f", (text, pat, 2, 16, True, False)))
      Equal(
          search(text, pat, True), ("f", (text, pat, 2, 10, True, True))
      )
      engine.backvar.set(True)
      Equal(search(text, pat), ("b", (text, pat, 2, 10, True, False)))
      Equal(
          search(text, pat, True), ("b", (text, pat, 2, 16, True, True))
      )
  
imports: from idlelib import searchengine
  import unittest
  from tkinter import BooleanVar, StringVar, TclError
  from tkinter import messagebox
  from idlelib.idle_test.mock_tk import Var, Mbox
  from idlelib.idle_test.mock_tk import Text
  import re
label_desc: Use image node_id 2 for calling the SearchTest obj's underlying member method code with example usage: obj.test_search() and returns: str, str, str