python (3.11.7)
    e	3                        d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl	m
Z
 ddlmZm
Z
mZ ddlmZ ddlmZ  e
d          Z eed	          r
d
ej        v Znej         odej         v Zd Z ej         eed
          d           G d dej                              Z G d dej                  Zedk    r ej                     dS dS )z:
Very minimal unittests for parts of the readline module.
    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                   f    e Zd ZdZd Z ej         eed          d          d             Z	d Z
dS )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                                            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'