diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/extmod/ujson_dumps.py | 23 | ||||
-rwxr-xr-x | tests/run-tests | 10 |
2 files changed, 31 insertions, 2 deletions
diff --git a/tests/extmod/ujson_dumps.py b/tests/extmod/ujson_dumps.py new file mode 100644 index 0000000000..6e858fd3f9 --- /dev/null +++ b/tests/extmod/ujson_dumps.py @@ -0,0 +1,23 @@ +try: + import ujson as json +except ImportError: + import json + +print(json.dumps(False)) +print(json.dumps(True)) +print(json.dumps(None)) +print(json.dumps(1)) +print(json.dumps(1.2)) +print(json.dumps('abc')) +print(json.dumps('\x01\x7e\x7f\x80\u1234')) +print(json.dumps([])) +print(json.dumps([1])) +print(json.dumps([1, 2])) +print(json.dumps([1, True])) +print(json.dumps(())) +print(json.dumps((1,))) +print(json.dumps((1, 2))) +print(json.dumps((1, (2, 3)))) +print(json.dumps({})) +print(json.dumps({"a":1})) +print(json.dumps({"a":(2,[3,None])})) diff --git a/tests/run-tests b/tests/run-tests index 34f855d08d..a96f3773e4 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -3,6 +3,7 @@ import os import subprocess import sys +import platform import argparse from glob import glob @@ -37,6 +38,11 @@ def run_tests(pyb, tests, args): if pyb is not None: skip_tests.add('float/float_divmod.py') # tested by float/float_divmod_relaxed.py instead + # Some tests are known to fail on 64-bit machines + if pyb is None and platform.architecture()[0] == '64bit': + skip_tests.add('extmod/uctypes_ptr_le.py') + skip_tests.add('extmod/uctypes_ptr_native_le.py') + # Some tests are known to fail with native emitter # Remove them from the below when they work if args.emit == 'native': @@ -153,10 +159,10 @@ def main(): if args.test_dirs is None: if pyb is None: # run PC tests - test_dirs = ('basics', 'micropython', 'float', 'import', 'io', 'misc', 'unicode', 'unix') + test_dirs = ('basics', 'micropython', 'float', 'import', 'io', 'misc', 'unicode', 'extmod', 'unix') else: # run pyboard tests - test_dirs = ('basics', 'micropython', 'float', 'misc', 'pyb', 'pybnative', 'inlineasm') + test_dirs = ('basics', 'micropython', 'float', 'misc', 'extmod', 'pyb', 'pybnative', 'inlineasm') else: # run tests from these directories test_dirs = args.test_dirs |