+++ /dev/null
-"""Unit tests for buffer objects.\r
-\r
-For now, tests just new or changed functionality.\r
-\r
-"""\r
-\r
-import unittest\r
-from test import test_support\r
-\r
-class BufferTests(unittest.TestCase):\r
-\r
- def test_extended_getslice(self):\r
- # Test extended slicing by comparing with list slicing.\r
- s = "".join(chr(c) for c in list(range(255, -1, -1)))\r
- b = buffer(s)\r
- indices = (0, None, 1, 3, 19, 300, -1, -2, -31, -300)\r
- for start in indices:\r
- for stop in indices:\r
- # Skip step 0 (invalid)\r
- for step in indices[1:]:\r
- self.assertEqual(b[start:stop:step],\r
- s[start:stop:step])\r
-\r
-\r
-def test_main():\r
- with test_support.check_py3k_warnings(("buffer.. not supported",\r
- DeprecationWarning)):\r
- test_support.run_unittest(BufferTests)\r
-\r
-if __name__ == "__main__":\r
- test_main()\r