aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDamien George2018-02-06 15:35:52 +1100
committerDamien George2018-02-15 11:35:42 +1100
commitd9bca1f7bddad762aac72b0fcbdd84eb22e1c3c1 (patch)
tree95ef6b75023fd554ce99e12cf09a81ef7d7d6e5b /tests
parent9e8b7b1b635889e365efe3e240c5fe97c0f8de0a (diff)
extmod/modujson: Implement ujson.dump() function.
Diffstat (limited to 'tests')
-rw-r--r--tests/extmod/ujson_dump.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/extmod/ujson_dump.py b/tests/extmod/ujson_dump.py
new file mode 100644
index 000000000..c80e533ed
--- /dev/null
+++ b/tests/extmod/ujson_dump.py
@@ -0,0 +1,18 @@
+try:
+ from uio import StringIO
+ import ujson as json
+except:
+ try:
+ from io import StringIO
+ import json
+ except ImportError:
+ print("SKIP")
+ raise SystemExit
+
+s = StringIO()
+json.dump(False, s)
+print(s.getvalue())
+
+s = StringIO()
+json.dump({"a": (2, [3, None])}, s)
+print(s.getvalue())