diff options
author | felix <felix.von.s@posteo.de> | 2021-07-13 09:18:20 +0200 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-07-14 05:02:43 +0530 |
commit | c843e685884ccc1a5186693d6450a34232b4377d (patch) | |
tree | 9d37f00402a8843158b0727b4a490a68b3717585 /test/test_utils.py | |
parent | 198f7ea89e89f0b3bc1f890cd4e5b98006fe9fa2 (diff) | |
download | hypervideo-pre-c843e685884ccc1a5186693d6450a34232b4377d.tar.lz hypervideo-pre-c843e685884ccc1a5186693d6450a34232b4377d.tar.xz hypervideo-pre-c843e685884ccc1a5186693d6450a34232b4377d.zip |
[utils] Improve `js_to_json` comment regex
Capture the newline character as part of a single-line comment
From #497, Authored by: fstirlitz
Diffstat (limited to 'test/test_utils.py')
-rw-r--r-- | test/test_utils.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py index 0067e1ec9..4bfe250ac 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -1054,6 +1054,9 @@ class TestUtil(unittest.TestCase): on = js_to_json('{ "040": "040" }') self.assertEqual(json.loads(on), {'040': '040'}) + on = js_to_json('[1,//{},\n2]') + self.assertEqual(json.loads(on), [1, 2]) + 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') |