File: //opt/alt/python312/lib64/python3.12/test/__pycache__/test_readline.cpython-312.opt-1.pyc
�
�h�e 3 � � � d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl m
Z
ddlmZm
Z
mZ ddlmZ ddlmZ e
d� Z eed � rd
ej* v Znej xr dej v Zd� Z ej0 eed
� d� G d� dej2 � � Z G d� dej2 � Zedk( r ej: � yy)z:
Very minimal unittests for parts of the readline module.
� N)�verbose)�
import_module)�unlink�temp_dir�TESTFN)�run_pty)�assert_python_ok�readline�_READLINE_LIBRARY_VERSIONzEditLine wrapper�libeditc �" � t r�t t d� r:t dt j d��� t dt j
d��� t t d� rt dt j ��� t dt � �� y y )N�_READLINE_VERSIONzreadline version: z#xzreadline runtime version: r zreadline library version: zuse libedit emulation? )r �hasattrr
�printr �_READLINE_RUNTIME_VERSIONr �is_editline� � �9/opt/alt/python312/lib64/python3.12/test/test_readline.py�setUpModuler s| � �� �8�0�1��&�x�'A�'A�"�&E�F�G��.�x�/Q�/Q�RT�.U�V�W��8�8�9��.�x�/Q�/Q�.T�U�V�
�'��}�5�6� r �
clear_historyzXThe history update test cannot be run because the clear_history method is not available.c �\ � e Zd ZdZd� Z ej eed� d� d� � Z d� Z
y)�TestHistoryManipulationz�
These tests were added to check that the libedit emulation on OSX and the
"real" readline have the same interface for history manipulation. That's
why the tests cover only a small subset of the interface.
c � � t j � t j d� t j d� | j t j d� d � | j t j d� d� | j t j d� d� t j dd� | j t j d� d � | j t j d� d� | j t j d� d� | j t j
� d� t j d� | j t j d� d � | j t j d� d� | j t j
� d� y )N�
first line�second liner � � z
replaced line)r
r �add_history�assertEqual�get_history_item�replace_history_item�get_current_history_length�remove_history_item)�selfs r �testHistoryUpdatesz*TestHistoryManipulation.testHistoryUpdates/ sR � ���� ����\�*����]�+�����2�2�1�5�t�<�����2�2�1�5�|�D�����2�2�1�5�}�E��%�%�a��9�����2�2�1�5�t�<�����2�2�1�5��G�����2�2�1�5�}�E�����<�<�>��B��$�$�Q�'�����2�2�1�5�t�<�����2�2�1�5�}�E�����<�<�>��Br �append_history_filezappend_history not availablec � � t j d�� }|j � |j }| j t
|� t j � t j d� t j d� t j |� t j � | j t j � d� t j |� | j t j � d� | j t j d� d� | j t j d� d� t j d|� t j � t j |� | j t j � d� | j t j d� d� | j t j d� d� | j t j d� d� t j
|� t j d|� t j
|� t j |� y # t $ r Y �!w xY w) NF)�deleter r r r r � )�tempfile�NamedTemporaryFile�close�name�
addCleanupr r
r r �write_history_filer r# �read_history_filer! r'