HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/test/test_tools/__pycache__/test_fixcid.cpython-311.pyc
�

��Vcg���dZddlmZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZm
Z
ddlZe��Gd�dej��ZdS)	zTest Tools/scripts/fixcid.py.�)�StringION)�support)�	os_helper)�skip_if_missing�
scriptsdirc�0�eZdZd�Zd�Zd�Zd
ddd�d�Zd	S)�Testc	��d}d}|�||z��}d}d}|�|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
rs      �/D:\Python311\Lib\test\test_tools\test_fixcid.py�test_parse_stringszTest.test_parse_stringssk��*��*��������-�-��*��*���!�!�&�
��V��D�t�$�V�G�G�		
�		
�		
�		
�		
�c�b�|�ddd���}|�|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)rrs  r�test_alter_commentszTest.test_alter_comments sR��������
!�

�

��	
�!�!�&�
�	
�	
�	
�	
�	
rc��tjtj��|�tjtj��tj�tjd��}t|dd���5}|�	d��ddd��n#1swxYwYttj�tjd��dd���5}|�	d��ddd��n#1swxYwYtj�td��}|�tjf�	��}|�|d
�
|����dS)Nzfile.c�w�utf-8��encodingzint xx;
zfile.pyzxx = 'unaltered'
�	fixcid.py)rz{}:
1
< int xx;
> int yy;
)�os�mkdirr�TESTFN�
addCleanup�rmtree�path�join�open�writerrrr)r�
c_filename�file�scriptrs     r�test_directoryzTest.test_directory<s���
���!�"�"�"����	�(�)�*:�;�;�;��W�\�\�)�"2�H�=�=�
�
�*�c�G�
4�
4�
4�	$���J�J�{�#�#�#�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$�
�"�'�,�,�y�/��;�;�S�"�$�$�$�	-�'+��J�J�+�,�,�,�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-����	-�	-�	-�	-�����j�+�6�6�����y�'7�&9��:�:���!�!�&�
�!�&��,�,�		
�	
�	
�	
�	
s$�B'�'B+�.B+�,D�D�D�)rzxx yy
)rrc	��tjdz}t|dd���5}|�|��ddd��n#1swxYwY|�tj|��dd|gt
|��z}tj�	td��}tjtd|��5tjtdt|����5tj��5}tj��5	t#j|d	�
��n2#t&$r%}	|�|	jd��Yd}	~	nd}	~	wwxYwddd��n#1swxYwYddd��n#1swxYwYddd��n#1swxYwYddd��n#1swxYwY|���S)Nz.substrrr r"z-s�argv�stdin�__main__)�run_namer)rr%r*r+r&�unlink�listr#r(r)rr�	swap_attr�sysr�captured_stdout�captured_stderr�runpy�run_path�
SystemExit�assertEqual�code�getvalue)
rrrr�
substfilenamer-r2r.r�exits
          rrzTest.run_scriptNs���!�(�8�3�
�
�-��w�
7�
7�
7�	"�4��J�J�y�!�!�!�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"����	"�	"�	"�	"����	�(�-�8�8�8��T�=�1�D��J�J�>������j�+�6�6��
�
�s�F�D�
1�
1�	/�	/��!�#�w�����@�@�	/�	/��'�)�)�	/�-3��'�)�)�	/�	/�
/���v�
�;�;�;�;�;���
/�
/�
/�� � ���A�.�.�.�.�.�.�.�.�����
/����
	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/����	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/����	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/����	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/����	/�	/�	/�	/���� � � s��A�A�A�)F1�-F�F�E,	�D.�-E,	�.
E�8E�E,	�E�E,	� F�,E0
�0F�3E0
�4F�7F�F�F�
F�F�F1�F	�F1�!F	�"F1�1F5�8F5N)r0)�__name__�
__module__�__qualname__rrr/r�rrr	r	sc������
�
�
�"
�
�
�8
�
�
�$!�6�Y�!�!�!�!�!�!�!rr	)�__doc__�iorr#�os.pathr<r9�testr�test.supportr�test.test_toolsrr�unittest�TestCaser	rGrr�<module>rPs���#�#�������������������
�
�
�
�������"�"�"�"�"�"�7�7�7�7�7�7�7�7����������P!�P!�P!�P!�P!�8��P!�P!�P!�P!�P!r