summaryrefslogtreecommitdiffstatshomepage
path: root/tests/extmod/ujson_loads_float.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-06-25 10:50:00 +0100
committerDamien George <damien.p.george@gmail.com>2015-06-25 10:50:00 +0100
commite44c1d3acef6d1a81e9496d1a4a8c4d12e2fd0a6 (patch)
tree4e52070b638ed299323e9ee0f9a151740e1da06e /tests/extmod/ujson_loads_float.py
parent186b355b286d00a46b3eb1db6341c17763f30f10 (diff)
downloadmicropython-e44c1d3acef6d1a81e9496d1a4a8c4d12e2fd0a6.tar.gz
micropython-e44c1d3acef6d1a81e9496d1a4a8c4d12e2fd0a6.zip
tests: Split out json float tests to separate files.
Diffstat (limited to 'tests/extmod/ujson_loads_float.py')
-rw-r--r--tests/extmod/ujson_loads_float.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/extmod/ujson_loads_float.py b/tests/extmod/ujson_loads_float.py
new file mode 100644
index 0000000000..f5e754608c
--- /dev/null
+++ b/tests/extmod/ujson_loads_float.py
@@ -0,0 +1,13 @@
+try:
+ import ujson as json
+except:
+ import json
+
+def my_print(o):
+ print('%.3f' % o)
+
+my_print(json.loads('1.2'))
+my_print(json.loads('1e2'))
+my_print(json.loads('-2.3'))
+my_print(json.loads('-2e3'))
+my_print(json.loads('-2e-3'))