Your IP : 216.73.217.32


Current Path : /opt/alt/python39/lib64/python3.9/test/test_json/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/test/test_json/__pycache__/test_scanstring.cpython-39.opt-1.pyc

a

XC?h/�@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)�z𝄠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 expressionrz{"Illegal invocation": alert()})zIllegal invocationrz+{"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/python39/lib64/python3.9/test/test_json/test_scanstring.py�test_scanstrings�

�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�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�
assertScanZs
�z2TestScanstring.test_surrogates.<locals>.assertScanz"z\ud834\u0079x"uz�yxz"z\ud834\udd20x"rz"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)rr!rr r�test_surrogatesXs








zTestScanstring.test_surrogatesc	Cs\|jjj}gd�}|D]@}|j|j|d��||dd�Wd�q1sL0YqdS)N)z"\"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_escapeshs

zTestScanstring.test_bad_escapescCsD|�t��&|jj�dtjd�Wd�n1s60YdS)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.��r.c@seZdZdS)�TestCScanstringNr/rrrrr1�r0r1)r(Ztest.test_jsonrrrr.r1rrrr�<module>s