HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/test/test_json/__pycache__/test_scanstring.cpython-37.opt-1.pyc
B

��g/�@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�:/usr/local/lib/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)Zgiven�expect)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)rr r)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