Your IP : 216.73.217.129


Current Path : /opt/alt/python37/lib64/python3.7/test/test_json/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/test/test_json/__pycache__/test_scanstring.cpython-37.pyc

B

� f/�@sNddlZddlmZmZGdd�d�ZGdd�dee�ZGdd�dee�ZdS)	�N)�PyTest�CTestc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TestScanstringcCs�|jjj}|�|ddd�d�|�|ddd�d�|�|ddd�d�|�|d	d
d�d�|�|dd
d�d
�|�|dd
d�d�|�|dd
d�d�|�|dd
d�d�|�|dd
d�d�|�|dd
d�d�|�|dd
d�d�|�|dd
d�d�|�|dd
d�d�|�|dd
d�d�|�|d d!d�d"�|�|d#d
d�d$�|�|d%d
d�d&�|�|d'd
d�d(�|�|d)d
d�d*�|�|d+d
d�d,�dS)-Nu"z𝄠x"�T)uz𝄠x�z"\u007b")�{�z<"A JSON payload should be an object or array, not a string.")z:A JSON payload should be an object or array, not a string.�<z["Unclosed array"�)zUnclosed array�z["extra comma",])zextra comma�z["double extra comma",,])zdouble extra comma�z["Comma after the close"],)zComma after the close�z["Extra close"]])zExtra closerz{"Extra comma": true,})zExtra commarz:{"Extra value after close": true} "misplaced quoted value")zExtra value after close�z{"Illegal expression": 1 + 2})zIllegal expressionr
z{"Illegal invocation": alert()})zIllegal invocationr
z+{"Numbers cannot have leading zeroes": 013})z"Numbers cannot have leading zeroes�%z{"Numbers cannot be hex": 0x14})zNumbers cannot be hexrz2[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]r
)zToo deep�z{"Missing colon" null})z
Missing colon�z{"Double colon":: null})zDouble colon�z {"Comma instead of colon", null})zComma instead of colon�z!["Colon instead of comma": false])zColon instead of commarz["Bad value", truth])z	Bad value�)�json�decoder�
scanstring�assertEqual)�selfr�r�C/opt/alt/python37/lib64/python3.7/test/test_json/test_scanstring.py�test_scanstringsz




















zTestScanstring.test_scanstringcsv�jjj���fdd�}|dd�|dd�|dd�|d	d
�|dd�|d
d�|dd�|dd�|dd
�dS)Ncs ���|dd�|t|�f�dS)NrT)r�len)ZgivenZexpect)rrrr�
assertScanZsz2TestScanstring.test_surrogates.<locals>.assertScanz"z\ud834\u0079x"uz�yxz"z\ud834\udd20x"uz𝄠xz"z\ud834\ud834\udd20x"u	z�𝄠xz
"z\ud834x"uz�xu"z\ud834�x12345"u
z��x12345z
"z\udd20x"uz�xu
"z��x"uz��xu
"z�\udd20x"u"z�x")rrr)rrr)rrr�test_surrogatesXs








zTestScanstring.test_surrogatescCsv|jjj}ddddddddd	d
ddd
ddddddddddg}x4|D],}|j|j|d��||dd�WdQRXqBWdS)Nz"\"z"\x"z"\u"z"\u0"z"\u01"z"\u012"z"\uz012"z"\u0z12"z"\u01z2"z"\u012z"z"\u0x12"z"\u0X12"z	"\ud834\"z
"\ud834\u"z"\ud834\ud"z"\ud834\udd"z
"\ud834\udd2"z"\ud834\uzdd2"z"\ud834\udzd2"z"\ud834\uddz2"z"\ud834\udd2z"z"\ud834\u0x20"z"\ud834\u0X20")�msgrT)rrr�assertRaisesZJSONDecodeError)rrZbad_escapes�srrr�test_bad_escapeshs6

zTestScanstring.test_bad_escapesc	Cs0|�t��|jj�dtjd�WdQRXdS)Nsxxxr)r"�
OverflowErrorrrr�sys�maxsize)rrrr�
test_overflow�szTestScanstring.test_overflowN)�__name__�
__module__�__qualname__rr r$r(rrrrrsRrc@seZdZdS)�TestPyScanstringN)r)r*r+rrrrr,�sr,c@seZdZdS)�TestCScanstringN)r)r*r+rrrrr-�sr-)r&Ztest.test_jsonrrrr,r-rrrr�<module>s