python (3.11.7)
    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          r
d	ej        v Znej        od
ej        v Zd Z ej         eed          d
           G d dej                              Z G d dej                  Zedk    r ej                     dS dS )    N)verbose)
import_module)unlinktemp_dirTESTFN)run_pty)assert_python_okreadline_READLINE_LIBRARY_VERSIONzEditLine wrapperlibeditc                  F   t           rt          t          d          r:t          dt          j        d           t          dt          j        d           t          t          d          rt          dt          j                   t          dt                      d S d S )N_READLINE_VERSIONzreadline version: z#xzreadline runtime version: r   zreadline library version: zuse libedit emulation? )r   hasattrr
   printr   _READLINE_RUNTIME_VERSIONr   is_editline     F/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/test_readline.pysetUpModuler      s     7 8011 	XFx'AFFFGGGVx/QVVVWWW8899 	WUx/QUUVVV
555666667 7r   
clear_historyzXThe history update test cannot be run because the clear_history method is not available.c                   d    e Zd Z	 d Z ej         eed          d          d             Zd Z	dS )TestHistoryManipulationc                    t                                            t                               d           t                               d           |                     t                               d          d            |                     t                               d          d           |                     t                               d          d           t                               dd           |                     t                               d          d            |                     t                               d          d           |                     t                               d          d           |                     t                                           d           t                               d           |                     t                               d          d            |                     t                               d          d           |                     t                                           d           d S )N
first linesecond liner         z
replaced line)r
   r   add_historyassertEqualget_history_itemreplace_history_itemget_current_history_lengthremove_history_item)selfs    r   testHistoryUpdatesz*TestHistoryManipulation.testHistoryUpdates/   s      \***]+++22155t<<<22155|DDD22155}EEE%%a99922155t<<<22155GGG22155}EEE<<>>BBB$$Q'''22155t<<<22155}EEE<<>>BBBBBr   append_history_filezappend_history not availablec                 $   t          j        d          }|                                 |j        }|                     t
          |           t                                           t                              d           t                              d           t          	                    |           t                                           | 
                    t                                          d           t                              |           | 
                    t                                          d           | 
                    t          
                    d          d           | 
                    t          
                    d          d           t                              d|           t                                           t                              |           | 
                    t                                          d           | 
                    t          
                    d          d           | 
                    t          
                    d          d           | 
                    t          
                    d          d           t          j        |           	 t                              d|           t          j        |           n# t           $ r Y nw xY wt          	                    |           d S )	NF)deleter   r   r   r   r      )tempfileNamedTemporaryFileclosename
addCleanupr   r
   r   r   write_history_filer    r#   read_history_filer!   r'