diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2023-05-24 23:05:20 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2023-05-24 23:30:45 +0530 |
commit | 7aeda6cc9e73ada0b0a0b6a6748c66bef63a20a8 (patch) | |
tree | 995084225bf8717c8adb9a1f7512a62f7cc7339d /test | |
parent | 15b2d3db1d40b0437fca79d8874d392aa54b3cdd (diff) | |
download | hypervideo-pre-7aeda6cc9e73ada0b0a0b6a6748c66bef63a20a8.tar.lz hypervideo-pre-7aeda6cc9e73ada0b0a0b6a6748c66bef63a20a8.tar.xz hypervideo-pre-7aeda6cc9e73ada0b0a0b6a6748c66bef63a20a8.zip |
[jsinterp] Do not compile regex
Diffstat (limited to 'test')
-rw-r--r-- | test/test_jsinterp.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/test_jsinterp.py b/test/test_jsinterp.py index 96274116b..4d44e6efe 100644 --- a/test/test_jsinterp.py +++ b/test/test_jsinterp.py @@ -8,7 +8,6 @@ import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import math -import re from yt_dlp.jsinterp import JS_Undefined, JSInterpreter @@ -275,7 +274,9 @@ class TestJSInterpreter(unittest.TestCase): def test_regex(self): self._test('function f() { let a=/,,[/,913,/](,)}/; }', None) + self._test('function f() { let a=/,,[/,913,/](,)}/; return a; }', R'/,,[/,913,/](,)}/0') + R''' # We are not compiling regex jsi = JSInterpreter('function f() { let a=/,,[/,913,/](,)}/; return a; }') self.assertIsInstance(jsi.call_function('f'), re.Pattern) @@ -287,6 +288,7 @@ class TestJSInterpreter(unittest.TestCase): jsi = JSInterpreter(R'function f() { let a=[/[)\\]/]; return a[0]; }') self.assertEqual(jsi.call_function('f').pattern, r'[)\\]') + ''' @unittest.skip('Not implemented') def test_replace(self): |