code: def test_new_features(self):
      # Test some of the new features in detail
      # (format, argument, big-endian result, little-endian result, asymmetric)
      tests = [
          ("c", b"a", b"a", b"a", 0),
          ("xc", b"a", b"\0a", b"\0a", 0),
          ("cx", b"a", b"a\0", b"a\0", 0),
          ("s", b"a", b"a", b"a", 0),
          ("0s", b"helloworld", b"", b"", 1),
          ("1s", b"helloworld", b"h", b"h", 1),
          ("9s", b"helloworld", b"helloworl", b"helloworl", 1),
          ("10s", b"helloworld", b"helloworld", b"helloworld", 0),
          ("11s", b"helloworld", b"helloworld\0", b"helloworld\0", 1),
          (
              "20s",
              b"helloworld",
              b"helloworld" + 10 * b"\0",
              b"helloworld" + 10 * b"\0",
              1,
          ),
          ("b", 7, b"\7", b"\7", 0),
          ("b", -7, b"\371", b"\371", 0),
          ("B", 7, b"\7", b"\7", 0),
          ("B", 249, b"\371", b"\371", 0),
          ("h", 700, b"\002\274", b"\274\002", 0),
          ("h", -700, b"\375D", b"D\375", 0),
          ("H", 700, b"\002\274", b"\274\002", 0),
          ("H", 0x10000 - 700, b"\375D", b"D\375", 0),
          ("i", 70000000, b"\004,\035\200", b"\200\035,\004", 0),
          ("i", -70000000, b"\373\323\342\200", b"\200\342\323\373", 0),
          ("I", 70000000, b"\004,\035\200", b"\200\035,\004", 0),
          (
              "I",
              0x100000000 - 70000000,
              b"\373\323\342\200",
              b"\200\342\323\373",
              0,
          ),
          ("l", 70000000, b"\004,\035\200", b"\200\035,\004", 0),
          ("l", -70000000, b"\373\323\342\200", b"\200\342\323\373", 0),
          ("L", 70000000, b"\004,\035\200", b"\200\035,\004", 0),
          (
              "L",
              0x100000000 - 70000000,
              b"\373\323\342\200",
              b"\200\342\323\373",
              0,
          ),
          ("f", 2.0, b"@\000\000\000", b"\000\000\000@", 0),
          (
              "d",
              2.0,
              b"@\000\000\000\000\000\000\000",
              b"\000\000\000\000\000\000\000@",
              0,
          ),
          ("f", -2.0, b"\300\000\000\000", b"\000\000\000\300", 0),
          (
              "d",
              -2.0,
              b"\300\000\000\000\000\000\000\000",
              b"\000\000\000\000\000\000\000\300",
              0,
          ),
          ("?", 0, b"\0", b"\0", 0),
          ("?", 3, b"\1", b"\1", 1),
          ("?", True, b"\1", b"\1", 0),
          ("?", [], b"\0", b"\0", 1),
          ("?", (1,), b"\1", b"\1", 1),
      ]
  
      for fmt, arg, big, lil, asy in tests:
          for xfmt, exp in [
              (">" + fmt, big),
              ("!" + fmt, big),
              ("<" + fmt, lil),
              ("=" + fmt, ISBIGENDIAN and big or lil),
          ]:
              res = struct.pack(xfmt, arg)
              self.assertEqual(res, exp)
              self.assertEqual(struct.calcsize(xfmt), len(res))
              rev = struct.unpack(xfmt, res)[0]
              if rev != arg:
                  self.assertTrue(asy)
  
imports: from collections import abc
  import array
  import gc
  import math
  import operator
  import unittest
  import struct
  import sys
  import weakref
  from test import support
  from test.support import import_helper
  from test.support.script_helper import assert_python_ok
label_desc: Use image node_id 4 for calling the StructTest obj's underlying member method code with example usage: obj.test_new_features() without return types