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.10/test/test_json/__pycache__/test_scanstring.cpython-310.opt-2.pyc
o

�i/�@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�;/usr/local/lib/python3.10/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)Zgiven�expect�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�n1s&wYqdS)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_escapescCsF|�t��|jj�dtjd�Wd�dS1swYdS)Nsxxxr)r%�
OverflowErrorrrr�sys�maxsize)rrrr�
test_overflow�s"�zTestScanstring.test_overflowN)�__name__�
__module__�__qualname__rr#r'r+rrrrrs
Rrc@�eZdZdS)�TestPyScanstringN�r,r-r.rrrrr0��r0c@r/)�TestCScanstringNr1rrrrr3�r2r3)r)Ztest.test_jsonrrrr0r3rrrr�<module>s