diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-09-01 13:14:04 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-09-01 16:46:32 +0530 |
commit | 05deb747bb18febb803b47119ca7bc432ffb80c8 (patch) | |
tree | 9b282436508c7029073168418beca578ce2f8207 /test/test_jsinterp.py | |
parent | b505e8517ad2ca8e07d5f9577dfd9a96165beaa0 (diff) | |
download | hypervideo-pre-05deb747bb18febb803b47119ca7bc432ffb80c8.tar.lz hypervideo-pre-05deb747bb18febb803b47119ca7bc432ffb80c8.tar.xz hypervideo-pre-05deb747bb18febb803b47119ca7bc432ffb80c8.zip |
[jsinterp] Fix escape in regex
Diffstat (limited to 'test/test_jsinterp.py')
-rw-r--r-- | test/test_jsinterp.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test_jsinterp.py b/test/test_jsinterp.py index 4b6e22bac..0cdf726fb 100644 --- a/test/test_jsinterp.py +++ b/test/test_jsinterp.py @@ -352,6 +352,11 @@ class TestJSInterpreter(unittest.TestCase): ''') self.assertEqual(jsi.call_function('x').flags & re.I, re.I) + jsi = JSInterpreter(''' + function x() { let a=/,][}",],()}(\[)/; return a; } + ''') + self.assertEqual(jsi.call_function('x').pattern, r',][}",],()}(\[)') + def test_char_code_at(self): jsi = JSInterpreter('function x(i){return "test".charCodeAt(i)}') self.assertEqual(jsi.call_function('x', 0), 116) |