From 0468a3b3253957bfbeb98b4a7c71542ff80e9e06 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Tue, 11 Oct 2022 07:59:27 +0530 Subject: [jsinterp] Improve separating regex Fixes https://github.com/yt-dlp/yt-dlp/issues/4635#issuecomment-1273974909 --- test/test_jsinterp.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/test_jsinterp.py') diff --git a/test/test_jsinterp.py b/test/test_jsinterp.py index 92ef532f5..3c4391c4a 100644 --- a/test/test_jsinterp.py +++ b/test/test_jsinterp.py @@ -392,6 +392,11 @@ class TestJSInterpreter(unittest.TestCase): ''') self.assertEqual(jsi.call_function('x').pattern, r',][}",],()}(\[)') + jsi = JSInterpreter(R''' + function x() { let a=[/[)\\]/]; return a[0]; } + ''') + 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) -- cgit v1.2.3