summaryrefslogtreecommitdiffstatshomepage
path: root/tests/extmod/ujson_loads_float.py
diff options
context:
space:
mode:
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'))