File: D:/Python311/Lib/test/test_tools/__pycache__/test_fixcid.cpython-311.pyc
�
��Vcg � � � d Z ddlmZ ddlZddlZddlZddlZddlmZ ddl m
Z
ddlmZm
Z
ddlZ e� � G d� dej � � ZdS ) zTest Tools/scripts/fixcid.py.� )�StringION)�support)� os_helper)�skip_if_missing�
scriptsdirc �0 � e Zd Zd� Zd� Zd� Zd
ddd�d�Zd S )�Testc � � d}d}| � ||z � � }d}d}| � |d� ||||�� � � � d S )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)�selfr r �outputr
r s �/D:\Python311\Lib\test\test_tools\test_fixcid.py�test_parse_stringszTest.test_parse_strings sk � �*��*��������-�-��*��*���!�!�&�
� �V��D�t�$�V�G�G�
�
�
�
�
� c �b � | � ddd�� � }| � |d� � d S )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;
)r r )r r s r �test_alter_commentszTest.test_alter_comments sR � �������
!�
�
��
�!�!�&�
�
�
�
�
�
r c � � t j t j � � | � t j t j � � t j � t j d� � }t |dd�� � 5 }|� d� � d d d � � n# 1 swxY w Y t t j � t j d� � dd�� � 5 }|� d� � d d d � � n# 1 swxY w Y t j � t d� � }| � t j f� � � }| � |d
�
|� � � � d S )Nzfile.c�w�utf-8��encodingzint xx;
zfile.pyzxx = 'unaltered'
� fixcid.py)r z{}:
1
< int xx;
> int yy;
)�os�mkdirr �TESTFN�
addCleanup�rmtree�path�join�open�writer r r r )r �
c_filename�file�scriptr s r �test_directoryzTest.test_directory<