mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-22 17:12:55 +08:00
43 lines
545 B
Python
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')
|