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/__pycache__/test_symbol.cpython-37.opt-2.pyc
B

��gl�@s�ddlZddlmZddlZddlZddlZddlZe�d�Zej	�
ej	�e�dddd�Z
dZGdd	�d	ej�Zed
kr�e��dS)�N)�supportz	symbol.pyz..ZIncludez
graminit.hzsymbol_test.pyc@s<eZdZdd�Zdd�Zdd�Ze�e�	�d�dd	��Z
d
S)�TestSymbolGenerationc	Csjt|��}|��}WdQRXt|d��:}|�|d|�d�d��|�||�d�d��WdQRXdS)N�wz#--start constants--
�z#--end constants--
)�open�	readlines�
writelines�index)�selfZsource_fileZ	dest_file�fp�lines�r
�,/usr/local/lib/python3.7/test/test_symbol.py�$_copy_file_without_generated_symbolss

z9TestSymbolGeneration._copy_file_without_generated_symbolscCs0tjtjt||gtjd�}|��d}|j|fS)N)�stderrr)�
subprocess�Popen�sys�
executable�SYMBOL_FILE�PIPEZcommunicate�
returncode)r
Zgrammar_fileZtarget_symbol_py_file�procrr
r
r�_generate_symbolssz&TestSymbolGeneration._generate_symbolsc	CsHt|��}|��}WdQRXt|��}|��}WdQRX|�||�dS)N)rr�assertEqual)r
Zfile1Zfile2rZlines1Zlines2r
r
r�
compare_files s


z"TestSymbolGeneration.compare_filesz+test only works from source build directorycCsXtj}|�tj|�|�t|�|�t|�\}}|�d|�|�d|�|�	t|�dS)N�r)
rZTESTFNZ
addCleanup�unlinkrrr�GRAMMAR_FILErr)r
�outputZexitcoderr
r
r�!test_real_grammar_and_symbol_file'sz6TestSymbolGeneration.test_real_grammar_and_symbol_fileN)�__name__�
__module__�__qualname__rrr�unittestZ
skipUnless�	sysconfigZis_python_buildr r
r
r
rrs

r�__main__)r$Ztestr�osrr%rZfindfiler�path�join�dirname�__file__rZTEST_PY_FILEZTestCaserr!�mainr
r
r
r�<module>s
'