Skip to content

Commit

Permalink
Unicode matching too hard for 3.2?
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkf authored Dec 12, 2024
1 parent 1e6397b commit 803210d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/test_jsinterp.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,11 +516,12 @@ def test_split(self):
['t', 'e', 's', 't'])
self._test('function f(){return "t-e-s-t".split(/[es-]+/)}',
['t', 't'])
# from MDN: surrogate pairs aren't handled: case 1 fails
# self._test('function f(){return "😄😄".split(/(?:)/)}',
# ['\ud83d', '\ude04', '\ud83d', '\ude04'])
self._test('function f(){return "😄😄".split(/(?:)/u)}',
['😄', '😄'])
# from MDN: surrogate pairs aren't handled: case 1 fails, and case 2 beats Py3.2
if sys.version_info >= (2, 6) and not ((3, 0) <= sys.version_info <= (3, 2)):
# self._test('function f(){return "😄😄".split(/(?:)/)}',
# ['\ud83d', '\ude04', '\ud83d', '\ude04'])
self._test('function f(){return "😄😄".split(/(?:)/u)}',
['😄', '😄'])

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])
Expand Down

0 comments on commit 803210d

Please sign in to comment.