
    ;eU                        d dl Z d dlmZ d dlZd dlZd dlZ G d dej                  Z G d dej                  Z G d dej                  Z	d	Z
d
ZdZdZdZdZdZdZ G d dej                  Z G d dej                  Z G d dej                  Z G d dej                  Z G d dej                  Zd Zd Zedk    r ej                     dS dS )    N)findfilec                        e Zd Zd Zd Zd ZdS )TestWithAsciic                 ~   t          j        d dd          }|                     |                                dd           |                     t          |                                          ddg           |                     |j        t                                 t          j        d dd          }|                     |                                dd           |                     t          |                                          g d	           |                     |j        t                                 d S )
Ndbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbeabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgףp=
?   places)insertr   r   r      )equalr   d   r   e   ebbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb))r   r   2   r   r   )r   r   r   r   3   )r   r   r   r   r   )	difflibSequenceMatcherassertAlmostEqualratioassertEquallistget_opcodesbpopularsetselfsms     (/usr/lib/python3.11/test/test_difflib.pytest_one_insertzTestWithAscii.test_one_insert	   s%   $T9oFFrxxzz5;;;bnn..//&)+	, 	, 	, 	cee,,,$T96OPPrxxzz5;;;bnn..//- - -	. 	. 	. 	cee,,,,,    c                     t          j        d dd          }|                     |                                dd           |                     t          |                                          g d           d S )NQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbg+?r	   r
   ))r   r   (   r   r&   )deleter&   )   r&   r&   )r   r(   Q   r&   P   )r   r   r   r   r   r   r   r   s     r    test_one_deletezTestWithAscii.test_one_delete   s    $T+DFYZZrxxzz5;;;bnn..//+ + +	, 	, 	, 	, 	,r"   c                 V   t          j        d dd          }|                     |j        t	                                 t          j        d dd          }|                     |j        dh           t          j        d dd          }|                     |j        dd	h           d S )
Nc                     | dk    S N  xs    r    <lambda>z*TestWithAscii.test_bjunk.<locals>.<lambda>!   
    a3h r"   r%   Taaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb)isjunkabc                     | dk    S r.   r0   r1   s    r    r3   z*TestWithAscii.test_bjunk.<locals>.<lambda>%   r4   r"   zhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb                    r/   c                 
    | dv S )N)r/   r8   r0   r1   s    r    r3   z*TestWithAscii.test_bjunk.<locals>.<lambda>)   s
    a:o r"   r8   )r   r   r   bjunkr   r   s     r    
test_bjunkzTestWithAscii.test_bjunk    s    $,>,>%)<> > >355)))$,>,>%)GI I IC5)))$,E,E%)GI I IC:.....r"   N)__name__
__module____qualname__r!   r+   r<   r0   r"   r    r   r      sA        - - -, , ,/ / / / /r"   r   c                       e Zd ZdZd ZdS )TestAutojunkz-Tests for the autojunk parameter added in 2.7c                    d}d}t          j        d ||          }|                     |                                dd           |                     |j        dh           t          j        d ||d          }|                     |                                d	d           |                     |j        t                                 d S )
Nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbr   r	   r
   r8   F)autojunkgQ?)r   r   r   r   r   r   r   )r   seq1seq2r   s       r    #test_one_insert_homogenous_sequencez0TestAutojunk.test_one_insert_homogenous_sequence0   s     $T466rxxzz1Q777se,,, $T4FFFrxxzz6!<<<cee,,,,,r"   N)r=   r>   r?   __doc__rH   r0   r"   r    rA   rA   .   s)        77- - - - -r"   rA   c                   2    e Zd Zd Zd Zd Zd Zd Zd ZdS )
TestSFbugsc                 "   t          j        d g g           }|                     |                                d           |                     |                                d           |                     |                                d           d S )Nr   )r   r   r   r   quick_ratioreal_quick_ratio)r   ss     r    test_ratio_for_null_seqnz#TestSFbugs.test_ratio_for_null_seqnA   sz    #D"b11A&&&!,,,++--q11111r"   c                    t          j        d g g                                           }|                     t          t
          |           t          j        g g           }|                     t          t
          |           d S N)r   r   get_grouped_opcodesassertRaisesStopIterationnextunified_diff)r   	group_gendiff_gens      r    test_comparing_empty_listsz%TestSFbugs.test_comparing_empty_listsH   sj    +D"b99MMOO	-y999'B//-x88888r"   c                 H   t          j        d dd          }|                                }|                                }|                     |d         j        d           |                     |d         j        d           |                     |d         j        d           d S )Nabxcdabcdr      r   )r   r   get_matching_blocksr   size)r   rO   firstseconds       r    test_matching_blocks_cachez%TestSFbugs.test_matching_blocks_cacheO   s    #D'6::%%''&&((+++++++++++r"   c                 R   t          t          j                                        dgdg                    }|                     d|d                    |                     d|d                    |                     d|d                    |                     d	|d
                    d S )Nz	I am a buggyz		I am a bugz- 	I am a buggyr   z? 	          --
r   z+ 		I am a bugr^   z? +
r	   r   r   Differcomparer   r   diffs     r    test_added_tab_hintzTestSFbugs.test_added_tab_hintX   s    GN$$,,.>-?AQ@RSSTT+T!W555-tAw777+T!W555$q'*****r"   c                    t          t          j                                        dgdg                    }|                     d|d                    |                     d|d                    |                     d|d                    d S )	Nz	 	 	^z	 	 	^
z- 	 	 	^r   z	+ 	 	 	^
r   z
? 	 	 	 +
r^   re   rh   s     r    %test_hint_indented_properly_with_tabsz0TestSFbugs.test_hint_indented_properly_with_tabs`   s    GN$$,,k]]OLLMMQ000$q'222)4733333r"   c           	      z    |                      t          t          j        dgdgd                    dg           d S )N23r   ))r   z -2)r   z +3T)r   r   r   _mdiff)r   s    r    test_mdiff_catch_stop_iterationz*TestSFbugs.test_mdiff_catch_stop_iterationf   sG    ua00119:	
 	
 	
 	
 	
r"   N)	r=   r>   r?   rP   rZ   rc   rj   rl   rq   r0   r"   r    rK   rK   @   sn        2 2 29 9 9, , ,+ + +4 4 4
 
 
 
 
r"   rK   z
   1. Beautiful is beTTer than ugly.
   2. Explicit is better than implicit.
   3. Simple is better than complex.
   4. Complex is better than complicated.
z
   1. Beautiful is better than ugly.
   3.   Simple is better than complex.
   4. Complicated is better than complex.
   5. Flat is better than nested.
u   
   1. Beautiful is beTTer than ugly.
   2. Explicit is better than ımplıcıt.
   3. Simple is better than complex.
   4. Complex is better than complicated.
u   
   1. Beautiful is better than ügly.
   3.   Sımple is better than complex.
   4. Complicated is better than cömplex.
   5. Flat is better than nested.
z
		Line 1: preceded by from:[tt] to:[ssss]
  		Line 2: preceded by from:[sstt] to:[sssst]
  	 	Line 3: preceded by from:[sstst] to:[ssssss]
Line 4:  	has from:[sst] to:[sss] after :
Line 5: has from:[t] to:[ss] at end	
z
    Line 1: preceded by from:[tt] to:[ssss]
    	Line 2: preceded by from:[sstt] to:[sssst]
      Line 3: preceded by from:[sstst] to:[ssssss]
Line 4:   has from:[sst] to:[sss] after :
Line 5: has from:[t] to:[ss] at end
zline 0
1234567890123456789012345689012345
line 1
line 2
line 3
line 4   changed
line 5   changed
line 6   changed
line 7
line 8  subtracted
line 9
1234567890123456789012345689012345
short line
just fits in!!
just fits in two lines yup!!
the endzline 0
1234567890123456789012345689012345
line 1
line 2    added
line 3
line 4   chanGEd
line 5a  chanGed
line 6a  changEd
line 7
line 8
line 9
1234567890
another long line that needs to be wrapped
just fitS in!!
just fits in two lineS yup!!
the endc                   ,    e Zd Zd Zd Zd Zd Zd ZdS )TestSFpatchesc           !         t           dz   dz  }t          dz   dz  }d|z   }d|z   }|                                }|                                }|                                }|                                }t                                          }t                                          }t
          }t          }t          j                    }	t          j        d          }
t          j        d          }|		                    ||dd	d
d          }d
                    d|	                    ||dd	d          d|	                    ||dd	d          d|	                    ||dd	dd          d|	                    ||dd	dd          d|	                    ||dd	d          d|	                    ||dd	d
          d|	                    g g dd	d          d|	                    g g dd	d
          d|
                    ||          d|	                    ||          d|                    |                                |                                dd          d|                    |                                |                                          d|                    |                    d          |                    d                    g          }|                    dd |z            }t          t          d!          d"#          5 }|                     ||                                           d d d            d S # 1 swxY w Y   d S )$Nz(123
123
123
123
123
123
123
123
123
123
r	   z(456
456
456
456
456
456
456
456
456
456
r^   )tabsize   )
wrapcolumnfromtoF   )contextnumlines
z8<h2>Context (first diff within numlines=5(default))</h2>T)r{   z7<h2>Context (first diff after numlines=5(default))</h2>z<h2>Context (numlines=6)</h2>   z<h2>Context (numlines=0)</h2>r   z<h2>Same Context</h2>z<h2>Same Full</h2>z<h2>Empty Context</h2>z<h2>Empty Full</h2>z<h2>tabsize=2</h2>z<h2>tabsize=default</h2>z+<h2>Context (wrapcolumn=14,numlines=0)</h2>z#<h2>wrapcolumn=14,splitlines()</h2>z'<h2>wrapcolumn=14,splitlines(True)</h2>z</body>z
%s
</body>ztest_difflib_expect.htmlzutf-8)encoding)patch914575_from1patch914575_to1
splitlinespatch914575_from2patch914575_to2patch914575_from3patch914575_to3r   HtmlDiff	make_filejoin
make_tablereplaceopenr   r   read)r   f1at1af1bt1bf2t2f3t3ijkfulltablesactualfps                   r    test_html_diffzTestSFpatches.test_html_diff   sC   !J.1+Q.33nnnnnnnn))++''))Q'''+++{{3s6$ua{HHG\\#c&d\;;F\\#c&d\;;,\\#c&dA\FF,\\#c&dA\FF$\\#c&d\;;!\\#c&e\<<%\\"RtD\99"\\"RtE\::!\\"R  '\\"R  :\\"--//"--//$PQ\RR2\\"--//"--//::6\\"----bmmD.A.ABB5 : i&(@AA (566III 	0RVRWWYY///	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0s   
)M  MMc                     t          j                    }d t          |dz            D             }d t          |dz            D             }t          j        d ||                                           d S )Nc                 &    g | ]}|d z  rdpd|z  S )r^   K:%dzV:A:%dr0   .0r   s     r    
<listcomp>z6TestSFpatches.test_recursion_limit.<locals>.<listcomp>   *    HHHA!*(a/HHHr"   r^   c                 &    g | ]}|d z  rdpd|z  S )r^   r   zV:B:%dr0   r   s     r    r   z6TestSFpatches.test_recursion_limit.<locals>.<listcomp>   r   r"   )sysgetrecursionlimitranger   r   r   )r   limitoldnews       r    test_recursion_limitz"TestSFpatches.test_recursion_limit   sq    %''HHuQwHHHHHuQwHHHc3//;;=====r"   c                     t          j                    }|                    t                                          t
                                                    }|                     d|           d S )Nz"content="text/html; charset=utf-8"r   r   r   r   r   r   assertInr   	html_diffoutputs      r    test_make_file_default_charsetz,TestSFpatches.test_make_file_default_charset   s`    $&&	$$%6%A%A%C%C%4%?%?%A%AC C:FCCCCCr"   c                     t          j                    }|                    t                                          t
                                          d          }|                     d|           d S )Nz
iso-8859-1charsetz'content="text/html; charset=iso-8859-1"r   r   s      r    test_make_file_iso88591_charsetz-TestSFpatches.test_make_file_iso88591_charset  sh    $&&	$$%6%A%A%C%C%4%?%?%A%A-9 % ; ; 	?HHHHHr"   c                    t          j                    }|                    t                                          t
                                          d          }|                     d|           |                     d|           d S )Nzus-asciir   z%content="text/html; charset=us-ascii"z&#305;mpl&#305;c&#305;t)r   r   r   patch914575_nonascii_from1r   patch914575_nonascii_to1r   r   s      r    2test_make_file_usascii_charset_with_nonascii_inputz@TestSFpatches.test_make_file_usascii_charset_with_nonascii_input  s}    $&&	$$%?%J%J%L%L%=%H%H%J%J-7 % 9 9 	=vFFF/88888r"   N)r=   r>   r?   r   r   r   r   r   r0   r"   r    rs   rs      sf        70 70 70r> > >D D DI I I9 9 9 9 9r"   rs   c                   &    e Zd Zd Zd Zd Zd ZdS )TestOutputFormatc                    g d}t          j        |ddi}|                     t          |          dd         ddg           t          j        |ddi}|                     t          |          dd         dd	g           d S )
N)onetwoOriginalCurrentz2005-01-26 23:30:50z2010-04-02 10:20:52lineterm r   r^   z --- Original	2005-01-26 23:30:50z+++ Current	2010-04-02 10:20:52z *** Original	2005-01-26 23:30:50z--- Current	2010-04-02 10:20:52r   rW   r   r   context_diffr   argsudcds       r    test_tab_delimiterz#TestOutputFormat.test_tab_delimiter  s    : : :!45"55b!A#>=)? 	@ 	@ 	@ !45"55b!A#>=)? 	@ 	@ 	@ 	@ 	@r"   c                    g d}t          j        |ddi}|                     t          |          dd         ddg           t          j        |ddi}|                     t          |          dd         dd	g           d S )
N)r   r   r   r   r   r   r   r^   z--- Originalz+++ Currentz*** Originalz--- Currentr   r   s       r    &test_no_trailing_tab_on_empty_filedatez7TestOutputFormat.test_no_trailing_tab_on_empty_filedate!  s    444!45"55b!A#(GHHH!45"55b!A#(GHHHHHr"   c                 b   d}t           j        }|                      |dd          d           |                      |dd          d           |                      |dd          d           |                      |dd          d	           |                      |d
d
          d           d S )Na             Each <range> field shall be of the form:
             %1d", <beginning line number>  if the range contains exactly one line,
           and:
            "%1d,%1d", <beginning line number>, <number of lines> otherwise.
           If a range is empty, its beginning line number shall be the number of
           the line just before the range, or 0 if the empty range starts the file.
        r	   z3,0   4rz   z4,2r~   z4,3r   z0,0)r   _format_range_unifiedr   r   specfmts      r    test_range_format_unifiedz*TestOutputFormat.test_range_format_unified)  s     +Qq5)))Qq3'''Qq5)))Qq5)))Qq5)))))r"   c                 b   d}t           j        }|                      |dd          d           |                      |dd          d           |                      |dd          d           |                      |dd          d	           |                      |d
d
          d           d S )Na             The range of lines in file1 shall be written in the following format
           if the range contains two or more lines:
               "*** %d,%d ****
", <beginning line number>, <ending line number>
           and the following format otherwise:
               "*** %d ****
", <ending line number>
           The ending line number of an empty range shall be the number of the preceding line,
           or 0 if the range is at the start of the file.

           Next, the range of lines in file2 shall be written in the following format
           if the range contains two or more lines:
               "--- %d,%d ----
", <beginning line number>, <ending line number>
           and the following format otherwise:
               "--- %d ----
", <ending line number>
        r	   ro   r   r   rz   z4,5r~   z4,6r   0)r   _format_range_contextr   r   s      r    test_range_format_contextz*TestOutputFormat.test_range_format_context:  s     +Qq3'''Qq3'''Qq5)))Qq5)))Qq3'''''r"   N)r=   r>   r?   r   r   r   r   r0   r"   r    r   r     sV        
@ 
@ 
@I I I* * *"( ( ( ( (r"   r   c                   8    e Zd Zd Zd Zd Zd Zd Zd Zd Z	dS )		TestBytesc                 l    t          |          }|D ]!}|                     |t          d|z             "d S )Nz.all lines of diff should be bytes, but got: %r)r   assertIsInstancebytes)r   ri   lines      r    checkzTestBytes.checkV  sX    Dzz 	I 	ID!!e@4GI I I I	I 	Ir"   c                 l   ddg}ddg}t           j        }t           j        }| j        } |t          j        |||                      |t          j        |||                      |t          j        |||dd                      |t          j        |||dd                      |t          j        |||dddd                      |t          j        |||dddd                      |t          j        |||                      |t          j        |||                      |t          j        |||dd                      |t          j        |||dd                      |t          j        |||dddd                      |t          j        |||dddd                     d S )N   hellos   andrs   andré   a   bs   2005s   2013)r   rW   r   r   
diff_bytes)r   r7   r8   unifiedr{   r   s         r    test_byte_contentzTestBytes.test_byte_content]  s   {#'&&
g !Q//000g !Q//000 	g !Qd;;<<<g !Qd;;<<< 	g !QdGWMMNNNg !QdGWMMNNN 	g !Q//000g !Q//000g !Qd;;<<<g !Qd;;<<<g !QdGWMMNNNg !QdGWMMNNNNNr"   c                 (    d}d}dg}dg} j         }t          j        }t          j        } |t          j        |||||                      |t          j        |||||                      fd}g d}	t          j        |||||d          }
 ||	|
           d	}d
} |t          j        |||||||                      |t          j        |||||||                     g d}	t          j        |||||||d          }
 ||	|
           d S )Ns   odz.txts	   łodz.txts   odz is a city in Poland.s   Łodz is a city in Poland.c                     t          |          }                    t          |           t          |                     t          | |          D ]\  }}                    ||           d S rR   )r   r   lenzip)expectr   er7   r   s       r    
assertDiffz1TestBytes.test_byte_filenames.<locals>.assertDiff  sr     &\\FS[[#f++666FF++ ' '1  A&&&&' 'r"   )s   --- odz.txts   +++ łodz.txt   @@ -1 +1 @@   -odz is a city in Poland.   +Łodz is a city in Poland.r"   )r   s
   2005-03-18s
   2005-03-19)s   --- odz.txt	2005-03-18s   +++ łodz.txt	2005-03-19r   r   r   )r   r   rW   r   r   )r   fnafnbr7   r8   r   r   r{   r   r   r   dateadatebs   `            r    test_byte_filenameszTestBytes.test_byte_filenamesy  s     --01
&&g !QS99:::g !QS99:::	' 	' 	' 	' 	'
 
 
 #GQ3cJJJ
66""" g !QS%GGHHHg !QS%GGHHH	
 	
 	
 #GQ3UE-02 2 2
66"""""r"   c                 "   dg}dg}t           j        }t           j        }d}|                     ||||           |                     ||||           |                     ||||           |                     ||||           d}|                     |t           j        |||           |                     |t           j        |||           |                     |t           j        |||           |                     |t           j        |||           d S )Nr   helloz2lines to compare must be str, not bytes (b'hello')z.all arguments must be bytes, not str ('hello'))r   rW   r   _assert_type_errorr   )r   r7   r8   r   r{   r   s         r    test_mixed_types_contentz"TestBytes.test_mixed_types_content  s   JI&&EA666A666A666A666A(:GQJJJ(:GQJJJ(:GQJJJ(:GQJJJJJr"   c                 b    dg}dg}d}d}|                      dt          j        ||||           d S )Nzhello
zohell
s   ol.txts	   ola9.txtz-all arguments must be str, not: b'ol\xe9.txt')r   r   rW   )r   r7   r8   r   r   s        r    test_mixed_types_filenamesz$TestBytes.test_mixed_types_filenames  sO     KK< !QS	2 	2 	2 	2 	2r"   c                     dg}dg}d}d}|                      dt          j        t          j        ||dd||	  	         dg}d	g}t	          t          j        ||d
d||                     d S )Ns   foo
s   bar
u   1 févu   3 févu/   all arguments must be bytes, not str ('1 fév')r   r   zfoo
zbar
r7   r8   )r   r   r   rW   r   )r   r7   r8   r   r   s        r    test_mixed_types_datesz TestBytes.test_mixed_types_dates  s    JJ= 4q$eU	, 	, 	, IIW!!QS%??@@@@@r"   c                     |                      t                    5 }t           ||            d d d            n# 1 swxY w Y   |                     |t	          |j                             d S rR   )rT   	TypeErrorr   r   str	exception)r   msg	generatorr   ctxs        r    r   zTestBytes._assert_type_error  s    y)) 	#SD!"""	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#c#-0011111s   :>>N)
r=   r>   r?   r   r   r   r   r   r   r   r0   r"   r    r   r   S  s        I I IO O O83# 3# 3#jK K K(
2 
2 
2A A A 2 2 2 2 2r"   r   c                   ,    e Zd Zd Zd Zd Zd Zd ZdS )TestJunkAPIsc                 z    dD ]7}|                      t          j        |          t          |                     8d S )N)#z  z #z# z # r   )
assertTruer   IS_LINE_JUNKreprr   r   s     r    test_is_line_junk_truez#TestJunkAPIs.test_is_line_junk_true  sG    6 	D 	DDOOG066T

CCCC	D 	Dr"   c                 z    dD ]7}|                      t          j        |          t          |                     8d S )N)##z ##z## zabc zabc #zMr. Moose is up!)assertFalser   r  r  r  s     r    test_is_line_junk_falsez$TestJunkAPIs.test_is_line_junk_false  sI    M 	E 	EDW1$77dDDDD	E 	Er"   c                 d    ddz  dz   }|                      t          j        |                     d S )N	i@B r  )r  r   r  )r   
evil_inputs     r    test_is_line_junk_REDOSz$TestJunkAPIs.test_is_line_junk_REDOS  s5    Wn,
-j99:::::r"   c                 z    dD ]7}|                      t          j        |          t          |                     8d S )N)r/   r  )r
  r   IS_CHARACTER_JUNKr  r   chars     r    test_is_character_junk_truez(TestJunkAPIs.test_is_character_junk_true  sG     	I 	IDOOG5d;;T$ZZHHHH	I 	Ir"   c                 z    dD ]7}|                      t          j        |          t          |                     8d S )N)r7   r	  r}   )r  r   r  r  r  s     r    test_is_character_junk_falsez)TestJunkAPIs.test_is_character_junk_false  sI    6 	J 	JDW6t<<d4jjIIII	J 	Jr"   N)r=   r>   r?   r  r  r  r  r   r0   r"   r    r  r    sm        D D DE E E; ; ;I I IJ J J J Jr"   r  c                        e Zd Zd Zd Zd ZdS )TestFindLongestc           
          t          fdfdt          dt                    z
  dz
            D             D                       S )Nc              3       K   | ]}|v V  	d S rR   r0   )r   b_partr7   s     r    	<genexpr>z6TestFindLongest.longer_match_exists.<locals>.<genexpr>  s?       G G66Q; G G G G G Gr"   c                 0    g | ]}||z   d z            S )r   r0   )r   r   r8   ns     r    r   z7TestFindLongest.longer_match_exists.<locals>.<listcomp>  s)    EEEqAaA	kNEEEr"   r   r   )anyr   r   )r   r7   r8   r(  s    ```r    longer_match_existsz#TestFindLongest.longer_match_exists  sv     G G G GEEEEEE!SVVaZ!^,D,DEEEG G G G G 	Gr"   c                    d}d}t          j        ||          }|                                }|                     |j        d           |                     |j        d           |                     |j        d           |                     ||j        |j        |j        z            ||j        |j        |j        z                       |                     |                     |||j                             |                    dd          }|                     |j        d	           |                     |j        d
           |                     |j        d           |                     ||j        |j        |j        z            ||j        |j        |j        z                       |                     |                     |dd          |dd          |j                             |                    dd          }|                     |j        d           |                     |j        d           |                     |j        d           |                     ||j        |j        |j        z            ||j        |j        |j        z                       |                     |                     ||dd         |j                             d S )Nzfoo barzfoo baz barr7   r8   r   r~   r^   r   )aloblor	      rz   r   )bhir.  )	r   r   find_longest_matchr   r7   r8   r`   r  r*  r   r7   r8   r   matchs        r    test_default_argsz!TestFindLongest.test_default_args  s   $qA...%%''!$$$!$$$Q'''57EGej$88957EGej$889	; 	; 	;11!Q
CCDDD%%!%33!$$$!$$$Q'''57EGej$88957EGej$889	; 	; 	;11!ABB%122
KKLLL%%!%33!$$$!$$$Q'''57EGej$88957EGej$889	; 	; 	;11!QqsVUZHHIIIIIr"   c                 2   d}d}t          j        ||          }|                    dt          |          dt          |                    }|                     |j        d           |                     |j        d           |                     |j        d           |                     ||j        |j        |j        z            ||j        |j        |j        z                       |                     | 	                    |||j                             d S )Ndabcdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddabcddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddr,  r   c   rz   )
r   r   r1  r   r   r7   r8   r`   r  r*  r2  s        r    %test_longest_match_with_popular_charsz5TestFindLongest.test_longest_match_with_popular_chars  s   %$qA...%%aQCFF;;!$$$"%%%Q'''57EGej$88957EGej$889	; 	; 	;11!Q
CCDDDDDr"   N)r=   r>   r?   r*  r4  r9  r0   r"   r    r"  r"    sL        G G GJ J J8
E 
E 
E 
E 
Er"   r"  c                  (    dt           j        _        d S )Nr   )r   r   _default_prefixr0   r"   r    setUpModuler<  &  s    '(G$$$r"   c                 ^    |                     t          j        t                               |S rR   )addTestdoctestDocTestSuiter   )loadertestspatterns      r    
load_testsrD  *  s$    	MM'&w//000Lr"   __main__)r   test.supportr   unittestr?  r   TestCaser   rA   rK   r   r   r   r   r   r   r   r   rs   r   r   r  r"  r<  rD  r=   mainr0   r"   r    <module>rJ     sJ    ! ! ! ! ! !   



#/ #/ #/ #/ #/H% #/ #/ #/L- - - - -8$ - - -$+
 +
 +
 +
 +
" +
 +
 +
\     ""U9 U9 U9 U9 U9H% U9 U9 U9p<( <( <( <( <(x( <( <( <(~N2 N2 N2 N2 N2! N2 N2 N2`J J J J J8$ J J J*+E +E +E +E +Eh' +E +E +E\) ) )  
 zHMOOOOO r"   