mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-06-15 17:11:57 +02:00
[utils] js_to_json
: Make function less fatal (#12715)
Authored by: seproDev
This commit is contained in:
parent
b7fbb5a0a1
commit
9491b44032
2 changed files with 3 additions and 1 deletions
|
@ -1260,6 +1260,7 @@ class TestUtil(unittest.TestCase):
|
|||
def test_js_to_json_malformed(self):
|
||||
self.assertEqual(js_to_json('42a1'), '42"a1"')
|
||||
self.assertEqual(js_to_json('42a-1'), '42"a"-1')
|
||||
self.assertEqual(js_to_json('{a: `${e("")}`}'), '{"a": "\\"e\\"(\\"\\")"}')
|
||||
|
||||
def test_js_to_json_template_literal(self):
|
||||
self.assertEqual(js_to_json('`Hello ${name}`', {'name': '"world"'}), '"Hello world"')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue