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

"��g��@slddlmZddlZddlZddlZddlZddlmZddlm	Z	m
Z
ddlZe	�Gdd�dej�Z
dS)�)�StringION)�support)�skip_if_missing�
scriptsdirc@s6eZdZdd�Zdd�Zdd�Zddd	d
�dd�Zd
S)�Testc	Cs<d}d}|�||�}d}d}|�|dj||||d��dS)Nzint xx = "xx\"xx"[xx];
zint xx = 'x\'xx' + xx;
zint yy = "xx\"xx"[yy];
zint yy = 'x\'xx' + yy;
z01
< {old1}> {new1}{new1}2
< {old2}> {new2}{new2})�old1�old2�new1�new2)�
run_script�assertMultiLineEqual�format)�selfrr�outputr	r
�r�7/usr/local/lib/python3.7/test/test_tools/test_fixcid.py�test_parse_stringsszTest.test_parse_stringscCs |jdddd�}|�|d�dS)Nz
xx yy
*aa bb
)z-c�-z4/* xx altered */
int xx;
/* aa unaltered */
int aa;
)�	substfile�args�inputz�1
< /* xx altered */
> /* yy altered */
/* yy altered */
2
< int xx;
> int yy;
int yy;
/* aa unaltered */
4
< int aa;
> int bb;
int bb;
)rr)rrrrr�test_alter_commentsszTest.test_alter_commentsc	Cs�t�tj�|�tjtj�tj�tjd�}t|d��}|�	d�WdQRXttj�tjd�d��}|�	d�WdQRXtj�t
d�}|jtjfd�}|�|d�
|��dS)	Nzfile.c�wzint xx;
zfile.pyzxx = 'unaltered'
z	fixcid.py)rz{}:
1
< int xx;
> int yy;
)�os�mkdirr�TESTFN�
addCleanupZrmtree�path�join�open�writerrrr
)rZ
c_filename�file�scriptrrrr�test_directory;szTest.test_directory�)rzxx yy
)rrc
Cstjd}t|d��}|�|�WdQRX|�tj|�dd|gt|�}tj�	t
d�}t�td|���t�tdt
|���rt���^}t���Jytj|dd�Wn0tk
r�}	z|�|	jd	�Wdd}	~	XYnXWdQRXWdQRXWdQRXWdQRX|��S)
Nz.substrz	fixcid.pyz-s�argv�stdin�__main__)Zrun_namer)rrrr r�unlink�listrrrrZ	swap_attr�sysrZcaptured_stdoutZcaptured_stderr�runpyZrun_path�
SystemExitZassertEqual�code�getvalue)
rrrrZ
substfilenamer!r%r"r�exitrrrrLs


HzTest.run_scriptN)r$)�__name__�
__module__�__qualname__rrr#rrrrrr
sr)�iorrZos.pathr+r*ZtestrZtest.test_toolsrrZunittestZTestCaserrrrr�<module>s