a
    zef                     @   sJ   d Z ddlmZ ddlZddlZG dd dejZedkrFejdd dS )	zTest mainmenu, coverage 100%.    )mainmenuNc                   @   s$   e Zd Zdd Zdd Zdd ZdS )MainMenuTestc                 C   s(   dd t jD }g d}| || d S )Nc                 S   s   g | ]}|d  qS )r    ).0itemr   r   5/usr/lib/python3.9/idlelib/idle_test/test_mainmenu.py
<listcomp>       z.MainMenuTest.test_menudefs.<locals>.<listcomp>)	fileZeditformatrunshelldebugoptionsZwindowhelp)r   menudefsZassertEqual)selfactualexpectr   r   r   test_menudefs   s    zMainMenuTest.test_menudefsc                 C   s   |  ttjd d S )N2   )ZassertGreaterEquallenr   Zdefault_keydefs)r   r   r   r   test_default_keydefs   s    z!MainMenuTest.test_default_keydefsc              	      s   dD ]\} | j | dj tjD ]}|d |kr" qJq"| d| d | t fdd|d D   d|  W d    q1 s0    Y  qd S )	N))r   z.*tack.*iewer)r   z.*ode.*ontext)r   z.*ine.*umbers)menupatternr   z not in menudefsc                 3   s&   | ]}|d urt  |d V  qd S )Nr   )research)r   Zmenuitemr   r   r   	<genexpr>#   s   z0MainMenuTest.test_tcl_indexes.<locals>.<genexpr>   z not in )ZsubTestr   r   Z
assertTrueany)r   r   Zmenutupr   r   r   test_tcl_indexes   s    
zMainMenuTest.test_tcl_indexesN)__name__
__module____qualname__r   r   r!   r   r   r   r   r   	   s   r   __main__   )	verbosity)	__doc__Zidlelibr   r   ZunittestZTestCaser   r"   mainr   r   r   r   <module>   s    