class_docstr: Test the StringEncoding module.
code: def test_string_contains_lone_surrogates(self):
      self.assertFalse(
          StringEncoding.string_contains_lone_surrogates("abc")
      )
      self.assertFalse(
          StringEncoding.string_contains_lone_surrogates("\uABCD")
      )
      self.assertFalse(
          StringEncoding.string_contains_lone_surrogates("\N{SNOWMAN}")
      )
  
      # This behaves differently in Py2 when freshly parsed and read from a .pyc file,
      # but it seems to be a marshalling bug in Py2, which doesn't hurt us in Cython.
      if sys.version_info[0] != 2:
          self.assertTrue(
              StringEncoding.string_contains_lone_surrogates(
                  "\uD800\uDFFF"
              )
          )
  
      # In Py2 with 16bit Unicode, the following is indistinguishable from the 32bit character.
      obfuscated_surrogate_pair = ("\uDFFF" + "\uD800")[::-1]
      if sys.version_info[0] == 2 and sys.maxunicode == 65565:
          self.assertFalse(
              StringEncoding.string_contains_lone_surrogates(
                  obfuscated_surrogate_pair
              )
          )
      else:
          self.assertTrue(
              StringEncoding.string_contains_lone_surrogates(
                  obfuscated_surrogate_pair
              )
          )
  
      self.assertTrue(
          StringEncoding.string_contains_lone_surrogates("\uD800")
      )
      self.assertTrue(
          StringEncoding.string_contains_lone_surrogates("\uDFFF")
      )
      self.assertTrue(
          StringEncoding.string_contains_lone_surrogates("\uDFFF\uD800")
      )
      self.assertTrue(
          StringEncoding.string_contains_lone_surrogates(
              "\uD800x\uDFFF"
          )
      )
  
imports: import sys
  import unittest
  import Cython.Compiler.StringEncoding
label_desc: Use image node_id 1 for calling the StringEncodingTest obj's underlying member method code with example usage: obj.test_string_contains_lone_surrogates() without return types