2023-07-06 23:09:49 +08:00

43 lines
545 B
Python

import json
# test parse failure
try:
json.loads('{')
except:
print('FAIL')
try:
json.loads('{"a":1,}')
except:
print('FAIL')
try:
json.loads('{"a":1,')
except:
print('FAIL')
try:
json.loads('{"a":1, "b":}')
except:
print('FAIL')
try:
json.loads('{"a":1, "b":, "c":3}')
except:
print('FAIL')
try:
json.loads('{"a":1 "b":2}')
except:
print('FAIL')
try:
json.loads('{"a":1, "b":2, "c":3,}')
except:
print('FAIL')
try:
json.loads('{"a":1, "b"2, "c":3}')
except:
print('FAIL')