code: def test_search(self):
      text = self.text
  
      # pattern and index are obligatory arguments.
      self.assertRaises(tkinter.TclError, text.search, None, "1.0")
      self.assertRaises(tkinter.TclError, text.search, "a", None)
      self.assertRaises(tkinter.TclError, text.search, None, None)
  
      # Invalid text index.
      self.assertRaises(tkinter.TclError, text.search, "", 0)
  
      # Check if we are getting the indices as strings -- you are likely
      # to get Tcl_Obj under Tk 8.5 if Tkinter doesn't convert it.
      text.insert("1.0", "hi-test")
      self.assertEqual(text.search("-test", "1.0", "end"), "1.2")
      self.assertEqual(text.search("test", "1.0", "end"), "1.3")
  
file_path: cpython/Lib/test/test_tkinter/test_text.py
imports: import unittest
  import tkinter
  from test.support import requires
  from test.test_tkinter.support import AbstractTkTest
label_desc: Use image node_id 3 for calling the TextTest obj's underlying member method code with example usage: obj.test_search() without return types