aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2015-02-18 23:59:50 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2015-02-18 23:59:51 +0100
commitd305dd73a3d6927f0a2c63d08662a183fa173833 (patch)
treec13bf94c2fc99d90d498bf97078a6f00973053d3 /test
parent85d586617750d38d742a24f141b099f6b898d269 (diff)
downloadyoutube-dl-d305dd73a3d6927f0a2c63d08662a183fa173833.tar.xz
[utils] Fix js_to_json
Previously, the runtime could be atrocious for longer inputs.
Diffstat (limited to 'test')
-rw-r--r--test/test_utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index 1c29d0889..c7373af1e 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -370,6 +370,10 @@ class TestUtil(unittest.TestCase):
"playlist":[{"controls":{"all":null}}]
}''')
+ inp = '"SAND Number: SAND 2013-7800P\\nPresenter: Tom Russo\\nHabanero Software Training - Xyce Software\\nXyce, Sandia\\u0027s"'
+ json_code = js_to_json(inp)
+ self.assertEqual(json.loads(json_code), json.loads(inp))
+
def test_js_to_json_edgecases(self):
on = js_to_json("{abc_def:'1\\'\\\\2\\\\\\'3\"4'}")
self.assertEqual(json.loads(on), {"abc_def": "1'\\2\\'3\"4"})