docstr: Test PyUnicode_Compare()
docstr_tok: ["Test","PyUnicode_Compare","(",")"]
code: def test_compare(self):
      """Test PyUnicode_Compare()"""
      from _testcapi import unicode_compare as compare
  
      self.assertEqual(compare("abc", "abc"), 0)
      self.assertEqual(compare("abc", "def"), -1)
      self.assertEqual(compare("def", "abc"), 1)
      self.assertEqual(compare("abc", "abc\0def"), -1)
      self.assertEqual(compare("abc\0def", "abc\0def"), 0)
      self.assertEqual(compare("абв", "abc"), 1)
  
      self.assertRaises(TypeError, compare, b"abc", "abc")
      self.assertRaises(TypeError, compare, "abc", b"abc")
      self.assertRaises(TypeError, compare, b"abc", b"abc")
      self.assertRaises(TypeError, compare, [], "abc")
      self.assertRaises(TypeError, compare, "abc", [])
      self.assertRaises(TypeError, compare, [], [])
  
imports: import unittest
  import sys
  from test import support
  from test.support import import_helper
label_desc: Use image node_id 40 for calling the CAPITest obj's underlying member method code with example usage: obj.test_compare() without return types