From 5f64dc55d89444fcc3a5903d658eb327e1b6ef74 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 2 Feb 2015 21:52:19 +0000 Subject: extmod: Make ujson.loads raise exception if given empty string. Addresses issue #1097. --- tests/extmod/ujson_loads.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/extmod') diff --git a/tests/extmod/ujson_loads.py b/tests/extmod/ujson_loads.py index 05bd62a9b..75e61dacd 100644 --- a/tests/extmod/ujson_loads.py +++ b/tests/extmod/ujson_loads.py @@ -33,3 +33,9 @@ my_print(json.loads('{"a":[], "b":[1], "c":{"3":4}}')) # whitespace handling my_print(json.loads('{\n\t"a":[]\r\n, "b":[1], "c":{"3":4} \n\r\t\r\r\r\n}')) + +# loading nothing should raise exception +try: + json.loads('') +except ValueError: + print('ValueError') -- cgit v1.2.3