class_docstr: Define items common to both sets of tests.
class_docstr_tok: ["Define","items","common","to","both","sets","of","tests","."]
code: def test_compare(self):
      compare = self.text.compare
      Equal = self.assertEqual
      # need data so indexes not squished to 1,0
      self.text.insert("1.0", "First\nSecond\nThird\n")
  
      self.assertRaises(TclError, compare, "2.2", "op", "2.2")
  
      for op, less1, less0, equal, greater0, greater1 in (
          ("<", True, True, False, False, False),
          ("<=", True, True, True, False, False),
          (">", False, False, False, True, True),
          (">=", False, False, True, True, True),
          ("==", False, False, True, False, False),
          ("!=", True, True, False, True, True),
      ):
          Equal(compare("1.1", op, "2.2"), less1, op)
          Equal(compare("2.1", op, "2.2"), less0, op)
          Equal(compare("2.2", op, "2.2"), equal, op)
          Equal(compare("2.3", op, "2.2"), greater0, op)
          Equal(compare("3.3", op, "2.2"), greater1, op)
  
imports: import unittest
  from test.support import requires
  from _tkinter import TclError
label_desc: Use image node_id 10 for calling the TextTest obj's underlying member method code with example usage: obj.test_compare() without return types