Unicode matching too hard for 3.2?

This commit is contained in:
dirkf 2024-12-12 16:26:57 +00:00 committed by GitHub
parent 1e6397b4ac
commit 803210d287
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -516,11 +516,12 @@ class TestJSInterpreter(unittest.TestCase):
['t', 'e', 's', 't']) ['t', 'e', 's', 't'])
self._test('function f(){return "t-e-s-t".split(/[es-]+/)}', self._test('function f(){return "t-e-s-t".split(/[es-]+/)}',
['t', 't']) ['t', 't'])
# from MDN: surrogate pairs aren't handled: case 1 fails # from MDN: surrogate pairs aren't handled: case 1 fails, and case 2 beats Py3.2
# self._test('function f(){return "😄😄".split(/(?:)/)}', if sys.version_info >= (2, 6) and not ((3, 0) <= sys.version_info <= (3, 2)):
# ['\ud83d', '\ude04', '\ud83d', '\ude04']) # self._test('function f(){return "😄😄".split(/(?:)/)}',
self._test('function f(){return "😄😄".split(/(?:)/u)}', # ['\ud83d', '\ude04', '\ud83d', '\ude04'])
['😄', '😄']) self._test('function f(){return "😄😄".split(/(?:)/u)}',
['😄', '😄'])
def test_slice(self): def test_slice(self):
self._test('function f(){return [0, 1, 2, 3, 4, 5, 6, 7, 8].slice()}', [0, 1, 2, 3, 4, 5, 6, 7, 8]) self._test('function f(){return [0, 1, 2, 3, 4, 5, 6, 7, 8].slice()}', [0, 1, 2, 3, 4, 5, 6, 7, 8])