python (3.11.7)
    e
                        d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlmZ  ej	        d            ej
        ej        dd         dk    d           G d d	ej                              Z
d
 Zedk    r ej                     dS dS )    N)supportT)module   winz can't easily test on this systemc                   &   e Zd Z G d d          Z G d d          Zd Z ej        ej	        
                    d          d          d             Zd	 Z e
j                    d
             Z ej        e
j        d          d             Zd
 ZdS )SelectTestCasec                       e Zd ZdS )SelectTestCase.NopeN)__name__
__module____qualname__     D/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/test_select.pyNoper
      s        r   r   c                       e Zd Zd ZdS )SelectTestCase.Almostc                     dS )Nfilenor   selfs    r   r   zSelectTestCase.Almost.fileno   s    8r   Nr   r   r
   r   r   r   r   Almostr      s#        	 	 	 	 	r   r   c                    |                      t          t          j        ddd           |                      t          t          j        |                                 gg g            |                      t          t          j        |                                 gg g            |                      t          t          j        g g g d           |                      t
          t          j        g g g d           d S )N      r   znot a number)assertRaises	TypeErrorselectr   r   
ValueErrorr   s    r   test_error_conditionsz$SelectTestCase.test_error_conditions   s    )V]Aq!<<<)V]TYY[[M2rJJJ)V]T[[]]ORLLL)V]BBOOO*fmRRDDDDDr   freebsdz*skip because of a FreeBSD bug: kern/155606c                    t          t          d          5 }|                                }|                                 	 t	          j        |gg g d           |                     d           n<# t          $ r/}|                     |j        t          j	                   Y d }~nd }~ww xY wd d d            d S # 1 swxY w Y   d S )Nrbr   zexception not raised)
open__file__r   closer    failOSErrorassertEqualerrnoEBADF)r   fpfderrs       r   
test_errnozSelectTestCase.test_errno   s    (D
!
! 	2RBHHJJJ
2
rdBA... 		01111  
9 
9 
9  EK88888888
9	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2s;   )B7 A.B7.
B'8%B"B7"B''B77B;>B;c                     t          j         g g g d          \  }}}|                     ||           |                     ||           |                     ||           d S )Nr   )r    assertIsNot)r   rwxs       r   test_returned_list_identityz*SelectTestCase.test_returned_list_identity,   se    -BA..1aAAAr   c                    t          j        d          }t          j        dd|g}t	          j        |t          j                  5 }|j        }dD ]}t          j	        rt          d|            t          j        |gg g |          \  }}}|                     |g            |                     |g            |sk||gk    r\|
                                }	t          j	        rt          t          |	                     |	st          j	        rt          d            n|                     d|||           d d d            d S # 1 swxY w Y   d S )	Nz
            import time
            for i in range(10):
                print("testing...", flush=True)
                time.sleep(0.050)
        z-Iz-c)stdout)r   r   r            NNNNNNNNNNz
timeout = EOFz'Unexpected return values from select():)textwrapdedentsys
executable
subprocessPopenPIPEr9   r   verboseprintr    r+   readlinereprr)   )
r   codecmdprocpipetimeoutrfdwfdxfdlines
             r   test_selectzSelectTestCase.test_select3   s      
 
 ~tT40
c*/
:
:
: 	)d;D; 
) 
)? 20w00111 &
tfb"g F F
S#  b)))  b))) 4&====??D *d4jj))) "? )!%LLL		CsC) ) ) )'	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	)s   C1EE
Ez-Emscripten cannot select a fd multiple times.c                     g  G fdd          } |            gdz  d d <