2014-09-17 17:56:34 -04:00
|
|
|
try:
|
|
|
|
import ujson as json
|
|
|
|
except ImportError:
|
2017-02-14 17:56:22 -05:00
|
|
|
try:
|
|
|
|
import json
|
|
|
|
except ImportError:
|
|
|
|
print("SKIP")
|
2017-06-10 13:14:16 -04:00
|
|
|
raise SystemExit
|
2014-09-17 17:56:34 -04:00
|
|
|
|
|
|
|
print(json.dumps(False))
|
|
|
|
print(json.dumps(True))
|
|
|
|
print(json.dumps(None))
|
|
|
|
print(json.dumps(1))
|
2021-03-15 09:57:36 -04:00
|
|
|
print(json.dumps("abc"))
|
|
|
|
print(json.dumps("\x00\x01\x7e"))
|
2014-09-17 17:56:34 -04:00
|
|
|
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({}))
|
2021-03-15 09:57:36 -04:00
|
|
|
print(json.dumps({"a": 1}))
|
|
|
|
print(json.dumps({"a": (2, [3, None])}))
|
2015-03-14 17:20:58 -04:00
|
|
|
print(json.dumps('"quoted"'))
|
2021-03-15 09:57:36 -04:00
|
|
|
print(json.dumps("space\n\r\tspace"))
|
2021-04-23 15:26:42 -04:00
|
|
|
print(json.dumps({None: -1}))
|
|
|
|
print(json.dumps({False: 0}))
|
|
|
|
print(json.dumps({True: 1}))
|
|
|
|
print(json.dumps({1: 2}))
|