summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-02-02 21:52:19 +0000
committerDamien George <damien.p.george@gmail.com>2015-02-02 21:52:19 +0000
commit5f64dc55d89444fcc3a5903d658eb327e1b6ef74 (patch)
tree94effbc0fd58bc50ba682dc99d0f83102c1446c7 /tests
parente8b877be6018893f1250c87424c3886f115b0051 (diff)
downloadmicropython-5f64dc55d89444fcc3a5903d658eb327e1b6ef74.tar.gz
micropython-5f64dc55d89444fcc3a5903d658eb327e1b6ef74.zip
extmod: Make ujson.loads raise exception if given empty string.
Addresses issue #1097.
Diffstat (limited to 'tests')
-rw-r--r--tests/extmod/ujson_loads.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/extmod/ujson_loads.py b/tests/extmod/ujson_loads.py
index 05bd62a9b2..75e61dacd9 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')