Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/test/test_ucn.py

    r2 r391  
    99
    1010import unittest
     11import sys
     12import _testcapi
    1113
    1214from test import test_support
     
    138140        )
    139141
     142    @unittest.skipUnless(_testcapi.INT_MAX < _testcapi.PY_SSIZE_T_MAX,
     143                         "needs UINT_MAX < SIZE_MAX")
     144    @unittest.skipUnless(_testcapi.UINT_MAX < sys.maxint,
     145                         "needs UINT_MAX < sys.maxint")
     146    @test_support.bigmemtest(minsize=_testcapi.UINT_MAX + 1,
     147                             memuse=2 + 4 // len(u'\U00010000'))
     148    def test_issue16335(self, size):
     149        func = self.test_issue16335
     150        if size < func.minsize:
     151            raise unittest.SkipTest("not enough memory: %.1fG minimum needed" %
     152                    (func.minsize * func.memuse / float(1024**3),))
     153        # very very long bogus character name
     154        x = b'\\N{SPACE' + b'x' * int(_testcapi.UINT_MAX + 1) + b'}'
     155        self.assertEqual(len(x), len(b'\\N{SPACE}') +
     156                                    (_testcapi.UINT_MAX + 1))
     157        self.assertRaisesRegexp(UnicodeError,
     158            'unknown Unicode character name',
     159            x.decode, 'unicode-escape'
     160        )
     161
     162
    140163def test_main():
    141164    test_support.run_unittest(UnicodeNamesTest)
Note: See TracChangeset for help on using the changeset viewer.