[utils] Correct octal/hexadecimal number detection in js_to_json
This commit is contained in:
parent
9e5751b9fe
commit
e4659b4547
3 changed files with 12 additions and 3 deletions
|
@ -712,6 +712,9 @@ class TestUtil(unittest.TestCase):
|
|||
inp = '''{"foo":101}'''
|
||||
self.assertEqual(js_to_json(inp), '''{"foo":101}''')
|
||||
|
||||
inp = '''{"duration": "00:01:07"}'''
|
||||
self.assertEqual(js_to_json(inp), '''{"duration": "00:01:07"}''')
|
||||
|
||||
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"})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue