
    
8d                         d dl Z d dlZd dlmZmZ d dlmZmZ ddlm	Z	 ej
                            e	d           G d d	e j                              Zed
k    rd dlZ ej                     dS dS )    N)QtGui	QtWidgets)KillRing
QtKillRing   )
no_displayzDoesn't work without a display)reasonc                   L    e Zd Zed             Zed             Zd Zd Zd ZdS )TestKillRingc                     t           j                                        | _        | j        t          j        g           | _        | j                            d           dS )z3 Create the application for the test case.
        NF)r   QApplicationinstance_appsetQuitOnLastWindowClosedclss    >lib/python3.11/site-packages/qtconsole/tests/test_kill_ring.py
setUpClasszTestKillRing.setUpClass   sP     )22448 -b11CH**511111    c                 B    t           j                                         dS )z Exit the application.
        N)r   r   quitr   s    r   tearDownClasszTestKillRing.tearDownClass   s     	##%%%%%r   c                 x   t                      }|                     |                                du            |                     |                                du            |                    d           |                     |                                d           |                     |                                du            |                     |                                d           |                    d           |                     |                                d           |                     |                                d           |                                 |                     |                                du            |                     |                                du            dS )z* Does the generic kill ring work?
        Nfoobar)r   
assertTrueyankrotatekillassertEqualclear)selfrings     r   test_genericzTestKillRing.test_generic   sW    zz		t+,,,-...		%e,,,-...e,,,		%e,,,...

		t+,,,-.....r   c                    t          j                    }t          |          }|                    d           |                    d           |                                 |                                 |                                 |                     |                                d           |                                 |                    d           |                                 |                                 |                                 |                                 |                     |                                d           dS )z% Does the Qt kill ring work?
        r   r   foobarbazN)	r   QPlainTextEditr   r   r   r   r    toPlainTextr!   r"   	text_editr#   s      r   test_qt_basiczTestKillRing.test_qt_basic0   s
    ,..	)$$		%		%				..00(;;;		%		..00%88888r   c                    t          j                    }t          |          }|                    d           |                    d           |                                 |                    t          j        j                   |	                                 | 
                    |                                d           dS )zD Does the Qt kill ring maintain state with cursor movement?
        r   r   N)r   r(   r   r   r   
moveCursorr   QTextCursorLeftr   r    r)   r*   s      r   test_qt_cursorzTestKillRing.test_qt_cursorE   s     ,..	)$$		%		%		U.3444..00%88888r   N)	__name__
__module____qualname__classmethodr   r   r$   r,   r1    r   r   r   r   
   sw         2 2 [2 & & [&
/ / /(9 9 9*9 9 9 9 9r   r   __main__)unittestpytestqtpyr   r   qtconsole.kill_ringr   r    r   markskipifTestCaser   r2   mainr6   r   r   <module>rA      s      ! ! ! ! ! ! ! ! 4 4 4 4 4 4 4 4       J'GHHE9 E9 E9 E9 E98$ E9 E9 IHE9P zMMMFKMMMMM r   