�
�h�e 3 � � � d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlm Z d dl
mZmZm
Z
d dlmZ d dlmZ e d� Z eed� rd ej( v Znej, xr d
ej, v Zd� Z ej0 eed� d
� G d� dej2 � � Z G d� dej2 � Zedk( r ej: � yy)� 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 �Z � e Zd Z d� Z ej
eed� d� d� � Zd� Z y)�TestHistoryManipulationc � � 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'