aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichal Čihař <michal@cihar.com>2017-01-31 07:54:53 +0100
committerSergey M․ <dstftw@gmail.com>2017-02-03 03:04:33 +0700
commitb3ee552e4b918fb720111b23147e24fa5475a74b (patch)
tree73b6f8b9ec2e2b0932ce8e922bffca4dc11c1830 /test
parenta22b2fd19bd8c08d50f884d1903486d4f00f76ec (diff)
downloadyoutube-dl-b3ee552e4b918fb720111b23147e24fa5475a74b.tar.xz
[utils] Handle single-line comments in js_to_json
Diffstat (limited to 'test')
-rw-r--r--test/test_utils.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index a74d59f34..954bb7d8b 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -791,6 +791,9 @@ class TestUtil(unittest.TestCase):
on = js_to_json('{ 0: /* " \n */ ",]" , }')
self.assertEqual(json.loads(on), {'0': ',]'})
+ on = js_to_json('{ 0: // comment\n1 }')
+ self.assertEqual(json.loads(on), {'0': 1})
+
on = js_to_json(r'["<p>x<\/p>"]')
self.assertEqual(json.loads(on), ['<p>x</p>'])